diff options
author | Andreas Schwab <schwab@suse.de> | 2013-01-24 12:32:09 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2013-09-30 10:29:13 +0200 |
commit | b2179107f3eabb5e349333cd5adc6e2fb4431990 (patch) | |
tree | 1a723f6ae54607a352f17983db026987734cf10c /nscd/initgrcache.c | |
parent | 47f28d0a6627c8b263df3c3e8f905bfaf42557bc (diff) | |
download | glibc-b2179107f3eabb5e349333cd5adc6e2fb4431990.zip glibc-b2179107f3eabb5e349333cd5adc6e2fb4431990.tar.gz glibc-b2179107f3eabb5e349333cd5adc6e2fb4431990.tar.bz2 |
Properly cache the result from looking up the nss database config
Diffstat (limited to 'nscd/initgrcache.c')
-rw-r--r-- | nscd/initgrcache.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c index 462780e..4580884 100644 --- a/nscd/initgrcache.c +++ b/nscd/initgrcache.c @@ -80,17 +80,16 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, } static service_user *group_database; - service_user *nip = NULL; + service_user *nip; int no_more; - if (group_database != NULL) - { - nip = group_database; - no_more = 0; - } - else + if (group_database == NULL) no_more = __nss_database_lookup ("group", NULL, - "compat [NOTFOUND=return] files", &nip); + "compat [NOTFOUND=return] files", + &group_database); + else + no_more = 0; + nip = group_database; /* We always use sysconf even if NGROUPS_MAX is defined. That way, the limit can be raised in the kernel configuration without having to |