summaryrefslogtreecommitdiff
path: root/grp
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-10-14 17:57:07 +0200
committerAndreas Schwab <schwab@redhat.com>2011-10-17 09:53:10 +0200
commit629f62ef0fbda8602cf796b24df79fb126f06851 (patch)
tree5f799fdff4ffa005c074cb72e4a7538e7b4d6a59 /grp
parentaa78043a4aafe5db1a1a76d544a833b63b4c5f5c (diff)
downloadglibc-629f62ef0fbda8602cf796b24df79fb126f06851.tar.gz
Correctly handle missing initgroups database
Diffstat (limited to 'grp')
-rw-r--r--grp/initgroups.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/grp/initgroups.c b/grp/initgroups.c
index 48119ff7f2..c63bba1388 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