Skip to content

Commit

Permalink
Fix lookup of group names in hesiod initgroups.
Browse files Browse the repository at this point in the history
Resolving names from a grplist entry actually never worked.
  • Loading branch information
Andreas Schwab authored and Ulrich Drepper committed Sep 3, 2009
1 parent 5d2e697 commit 2eeb9a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2009-09-01 Andreas Schwab <schwab@redhat.com>

* hesiod/nss_hesiod/hesiod-grp.c (internal_gid_from_group): Fix
parsing of group entry.

2009-09-02 Andreas Schwab <schwab@redhat.com>

* libio/wfileops.c (_IO_wfile_seekoff): Account for readahead in
Expand Down
8 changes: 3 additions & 5 deletions hesiod/nss_hesiod/hesiod-grp.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,19 @@ internal_gid_from_group (void *context, const char *groupname, gid_t *group)
{
char *p = *grp_res;

/* Skip to third field. */
while (*p != '\0' && *p != ':')
++p;
while (*p != '\0' && *p == ':')
if (*p != '\0')
++p;
while (*p != '\0' && *p != ':')
++p;
while (*p != '\0' && *p == ':')
++p;
if (*p == ':')
if (*p != '\0')
{
char *endp;
char *q = ++p;
long int val;

q = p;
while (*q != '\0' && *q != ':')
++q;

Expand Down

0 comments on commit 2eeb9a5

Please sign in to comment.