From: Andreas Schwab Date: Fri, 14 Oct 2011 15:57:07 +0000 (+0200) Subject: Correctly handle missing initgroups database X-Git-Tag: glibc-2.15~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=629f62ef0fbda8602cf796b24df79fb126f06851;p=thirdparty%2Fglibc.git Correctly handle missing initgroups database --- diff --git a/ChangeLog b/ChangeLog index dfd6a3b08a0..ab651ff3add 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-10-17 Andreas Schwab + + * grp/initgroups.c (internal_getgrouplist): Fix initgroups + database lookup. + 2011-10-16 Ulrich Drepper * misc/sys/cdefs.h: Use leaf function attribute in __THROW. diff --git a/grp/initgroups.c b/grp/initgroups.c index 48119ff7f2f..c63bba1388c 100644 --- a/grp/initgroups.c +++ b/grp/initgroups.c @@ -82,9 +82,8 @@ internal_getgrouplist (const char *user, gid_t group, long int *size, if (__nss_initgroups_database == NULL) { - no_more = __nss_database_lookup ("initgroups", NULL, "", - &__nss_initgroups_database); - if (no_more == 0 && __nss_initgroups_database == NULL) + if (__nss_database_lookup ("initgroups", NULL, "", + &__nss_initgroups_database) < 0) { if (__nss_group_database == NULL) no_more = __nss_database_lookup ("group", NULL, "compat files", @@ -92,11 +91,8 @@ internal_getgrouplist (const char *user, gid_t group, long int *size, __nss_initgroups_database = __nss_group_database; } - else if (__nss_initgroups_database != NULL) - { - assert (no_more == 0); - use_initgroups_entry = true; - } + else + use_initgroups_entry = true; } else /* __nss_initgroups_database might have been set through