summaryrefslogtreecommitdiff
path: root/hesiod
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2009-09-02 19:48:39 -0700
committerUlrich Drepper <drepper@redhat.com>2009-09-02 19:48:39 -0700
commit2eeb9a5d73bd86261b69e61955741e3ce86c28f6 (patch)
tree82678415b663239935b8fa463f89573b566d363e /hesiod
parent5d2e69766a8faba5bae37702094c36113365a6ca (diff)
downloadglibc-2eeb9a5d73bd86261b69e61955741e3ce86c28f6.tar.gz
Fix lookup of group names in hesiod initgroups.
Resolving names from a grplist entry actually never worked.
Diffstat (limited to 'hesiod')
-rw-r--r--hesiod/nss_hesiod/hesiod-grp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/hesiod/nss_hesiod/hesiod-grp.c b/hesiod/nss_hesiod/hesiod-grp.c
index 50c53f7893..f0c8c31e06 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;