From: Andreas Schwab Date: Thu, 3 Sep 2009 02:48:39 +0000 (-0700) Subject: Fix lookup of group names in hesiod initgroups. X-Git-Tag: fedora/glibc-2.10.90-20~1^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2eeb9a5d73bd86261b69e61955741e3ce86c28f6;p=thirdparty%2Fglibc.git Fix lookup of group names in hesiod initgroups. Resolving names from a grplist entry actually never worked. --- diff --git a/ChangeLog b/ChangeLog index 23cf69eae4c..01e7c91f811 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-01 Andreas Schwab + + * hesiod/nss_hesiod/hesiod-grp.c (internal_gid_from_group): Fix + parsing of group entry. + 2009-09-02 Andreas Schwab * libio/wfileops.c (_IO_wfile_seekoff): Account for readahead in diff --git a/hesiod/nss_hesiod/hesiod-grp.c b/hesiod/nss_hesiod/hesiod-grp.c index 50c53f7893d..f0c8c31e060 100644 --- a/hesiod/nss_hesiod/hesiod-grp.c +++ b/hesiod/nss_hesiod/hesiod-grp.c @@ -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;