diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-08-02 00:08:03 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-08-02 00:08:03 +0000 |
commit | fbbc73b3d7fc1c1f4aa8c7f8d30ced6778c50506 (patch) | |
tree | 6e07dcee0e801aae4937016b279d4f997cc60dbd /nscd/initgrcache.c | |
parent | a4518922f3f43dded5669f40b12227ab76df80fe (diff) | |
download | glibc-fbbc73b3d7fc1c1f4aa8c7f8d30ced6778c50506.zip glibc-fbbc73b3d7fc1c1f4aa8c7f8d30ced6778c50506.tar.gz glibc-fbbc73b3d7fc1c1f4aa8c7f8d30ced6778c50506.tar.bz2 |
* nscd/initgrcache.c (addinitgroupsX): Judge successful lookups by
status of NSS calls, not the number of returned entries.
Diffstat (limited to 'nscd/initgrcache.c')
-rw-r--r-- | nscd/initgrcache.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c index f2ff03a..b4ae139 100644 --- a/nscd/initgrcache.c +++ b/nscd/initgrcache.c @@ -117,6 +117,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, goto out; /* Nothing added yet. */ + bool any_success = false; while (! no_more) { long int prev_start = start; @@ -158,6 +159,8 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, if (NSS_STATUS_TRYAGAIN > status || status > NSS_STATUS_RETURN) __libc_fatal ("illegal status in internal_getgrouplist"); + any_success |= status == NSS_STATUS_SUCCESS; + if (status != NSS_STATUS_SUCCESS && nss_next_action (nip, status) == NSS_ACTION_RETURN) break; @@ -171,7 +174,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, ssize_t total; ssize_t written; out: - if (start == 0) + if (!any_success) { /* Nothing found. Create a negative result record. */ written = total = sizeof (notfound); |