diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2008-02-01 23:18:55 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2008-02-01 23:18:55 +0100 |
commit | 9381b04ad85d7cacf092e67bb49b2576196a36ef (patch) | |
tree | 970de5cd57c0505b7ed7ed3977b8921871cf57d0 /nss | |
parent | 5bb9f8aade94d96f01c0414b887ab0a671a934dd (diff) |
do not set errno (and h_errno) if we got the last entry from get*ent() (this apparently is needed by coreutils' id and groups commands)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@601 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss')
-rw-r--r-- | nss/common.h | 1 | ||||
-rw-r--r-- | nss/hosts.c | 8 | ||||
-rw-r--r-- | nss/netgroup.c | 8 | ||||
-rw-r--r-- | nss/networks.c | 8 |
4 files changed, 1 insertions, 24 deletions
diff --git a/nss/common.h b/nss/common.h index 8287a87..964dc3b 100644 --- a/nss/common.h +++ b/nss/common.h @@ -103,7 +103,6 @@ TFILE *nslcd_client_open(void) #define ERROR_OUT_NOSUCCESS(fp,retv) \ (void)tio_close(fp); \ fp=NULL; \ - *errnop=ENOENT; \ return NSS_STATUS_NOTFOUND; /* The following macros to automatically generate get..byname(), diff --git a/nss/hosts.c b/nss/hosts.c index bfff918..a73b83b 100644 --- a/nss/hosts.c +++ b/nss/hosts.c @@ -58,14 +58,6 @@ #define ERROR_OUT_WRITEERROR(fp) \ ERROR_OUT_READERROR(fp) -#undef ERROR_OUT_NOSUCCESS -#define ERROR_OUT_NOSUCCESS(fp,retv) \ - (void)tio_close(fp); \ - fp=NULL; \ - *errnop=ENOENT; \ - *h_errnop=HOST_NOT_FOUND; \ - return NSS_STATUS_NOTFOUND; - /* read a single host entry from the stream, filtering on the specified address family, result is stored in result it will an empty entry if no addresses in the address family diff --git a/nss/netgroup.c b/nss/netgroup.c index fe824f5..5421da4 100644 --- a/nss/netgroup.c +++ b/nss/netgroup.c @@ -37,13 +37,7 @@ #define ERROR_OUT_NOSUCCESS(fp,retv) \ (void)tio_close(fp); \ fp=NULL; \ - if (result->first) \ - { \ - *errnop=ENOENT; \ - return NSS_STATUS_NOTFOUND; \ - } \ - else \ - return NSS_STATUS_RETURN; + return (result->first)?NSS_STATUS_NOTFOUND:NSS_STATUS_RETURN; /* function for reading a single result entry */ static enum nss_status read_netgrent( diff --git a/nss/networks.c b/nss/networks.c index 0cb0b2c..6b3dcd1 100644 --- a/nss/networks.c +++ b/nss/networks.c @@ -58,14 +58,6 @@ #define ERROR_OUT_WRITEERROR(fp) \ ERROR_OUT_READERROR(fp) -#undef ERROR_OUT_NOSUCCESS -#define ERROR_OUT_NOSUCCESS(fp,retv) \ - (void)tio_close(fp); \ - fp=NULL; \ - *errnop=ENOENT; \ - *h_errnop=HOST_NOT_FOUND; \ - return NSS_STATUS_NOTFOUND; - /* read a single network entry from the stream, ignoring entries that are not AF_INET (IPv4), result is stored in result */ static enum nss_status read_netent( |