From 9381b04ad85d7cacf092e67bb49b2576196a36ef Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 1 Feb 2008 22:18:55 +0000 Subject: 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 --- nss/common.h | 1 - nss/hosts.c | 8 -------- nss/netgroup.c | 8 +------- nss/networks.c | 8 -------- 4 files changed, 1 insertion(+), 24 deletions(-) (limited to 'nss') 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( -- cgit v1.2.3