Report if no record is found by initgroups in nss_files.

This commit is contained in:
Ulrich Drepper 2011-05-06 12:54:12 -04:00
parent a044697649
commit acd41f47ea
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2011-05-06 Ulrich Drepper <drepper@gmail.com>
* nss/nss_files/files-initgroups.c (_nss_files_initgroups_dyn): Return
NSS_STATUS_NOTFOUND if no record was found.
2011-05-05 Andreas Schwab <schwab@redhat.com>
* sunrpc/Makefile (headers): Add rpc/netdb.h.

View file

@ -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;
}