1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-10-21 14:53:53 +03:00

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 * inet/getnetgrent_r.c (internal_getnetgrent_r): Fix check for known
netgroups to read. netgroups to read.
(innetgr): Likewise.
2011-07-05 Roland McGrath <roland@hack.frob.com> 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) namep = namep->next)
if (strcmp (entry.val.group, namep->name) == 0) if (strcmp (entry.val.group, namep->name) == 0)
break; 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 if (namep == NULL
&& strcmp (netgroup, entry.val.group) != 0) && strcmp (netgroup, entry.val.group) != 0)
{ {