about summary refs log tree commit diff
path: root/nss/nss_files
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-06 12:54:12 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-06 12:54:12 -0400
commitacd41f47eae558eb35871de3af7114c43093ff99 (patch)
treee01b8b5779274ea580b2fe2ecb1bf91991764289 /nss/nss_files
parenta04469764964a82863e0f61659bfa2d875f6fb7e (diff)
downloadglibc-acd41f47eae558eb35871de3af7114c43093ff99.tar.gz
glibc-acd41f47eae558eb35871de3af7114c43093ff99.tar.xz
glibc-acd41f47eae558eb35871de3af7114c43093ff99.zip
Report if no record is found by initgroups in nss_files.
Diffstat (limited to 'nss/nss_files')
-rw-r--r--nss/nss_files/files-initgroups.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nss/nss_files/files-initgroups.c b/nss/nss_files/files-initgroups.c
index 4c7b9f8e6f..113abf2821 100644
--- a/nss/nss_files/files-initgroups.c
+++ b/nss/nss_files/files-initgroups.c
@@ -43,6 +43,7 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
   char *line = NULL;
   size_t linelen = 0;
   enum nss_status status = NSS_STATUS_SUCCESS;
+  bool any = false;
 
   size_t buflen = 1024;
   void *buffer = alloca (buflen);
@@ -118,6 +119,7 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
 
 	      groups[*start] = grp.gr_gid;
 	      *start += 1;
+	      any = true;
 
 	      break;
 	    }
@@ -131,5 +133,5 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
 
   fclose (stream);
 
-  return status;
+  return status == NSS_STATUS_SUCCESS && !any ? NSS_STATUS_NOTFOUND : status;
 }