Add the extra check also in innetgr

This commit is contained in:
Ulrich Drepper 2011-07-06 11:38:42 -04:00
parent 5d4cf04250
commit 960e5535b0
2 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@
* inet/getnetgrent_r.c (internal_getnetgrent_r): Fix check for known
netgroups to read.
(innetgr): Likewise.
2011-07-05 Roland McGrath <roland@hack.frob.com>

View File

@ -389,6 +389,11 @@ innetgr (const char *netgroup, const char *host, const char *user,
namep = namep->next)
if (strcmp (entry.val.group, namep->name) == 0)
break;
if (namep == NULL)
for (namep = entry.needed_groups; namep != NULL;
namep = namep->next)
if (strcmp (entry.val.group, namep->name) == 0)
break;
if (namep == NULL
&& strcmp (netgroup, entry.val.group) != 0)
{