Fix lookup of group names in hesiod initgroups.
authorAndreas Schwab <schwab@redhat.com>
Thu, 3 Sep 2009 02:48:39 +0000 (19:48 -0700)
committerUlrich Drepper <drepper@redhat.com>
Thu, 3 Sep 2009 02:48:39 +0000 (19:48 -0700)
Resolving names from a grplist entry actually never worked.

ChangeLog
hesiod/nss_hesiod/hesiod-grp.c

index 23cf69e..01e7c91 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 50c53f7..f0c8c31 100644 (file)
@@ -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;