diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-03-19 11:38:21 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-03-19 20:31:08 +0100 |
commit | f21efd66c2c634f8f5e3b151e04f9da459ff5f4e (patch) | |
tree | ad72244834d831680f20d674673cc786a54959fd /nss/common.h | |
parent | 7926326ac549bc0e6e3fd0dc9e8b9014f0bacde6 (diff) |
NSS: Return TRYAGAIN on zero-length buffer
One of our customers was running into a situation where glibc provided a
zero buffer, which is a condition that is retriable and the nss module
should return NSS_STATUS_TRYAGAIN not NSS_STATUS_UNAVAIL.
Diffstat (limited to 'nss/common.h')
-rw-r--r-- | nss/common.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nss/common.h b/nss/common.h index fccbdf9..7c21484 100644 --- a/nss/common.h +++ b/nss/common.h @@ -86,10 +86,15 @@ /* check validity of passed buffer (Glibc flavour) */ #define NSS_BUFCHECK \ - if ((buffer == NULL) || (buflen == 0)) \ + if (buffer == NULL) \ { \ *errnop = EINVAL; \ return NSS_STATUS_UNAVAIL; \ + } \ + if (buflen == 0) \ + { \ + *errnop = ERANGE; \ + return NSS_STATUS_TRYAGAIN; \ } #endif /* NSS_FLAVOUR_GLIBC */ |