1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

Correctly handle missing initgroups database

This commit is contained in:
Andreas Schwab
2011-10-14 17:57:07 +02:00
parent aa78043a4a
commit 629f62ef0f
2 changed files with 9 additions and 8 deletions

View File

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