Bug 19375

Summary: hesiod/nss_hesiod/hesiod-grp.c (_nss_hesiod_initgroups_dyn)
Product: [Retired] Red Hat Linux Reporter: Tomas Winkler <tomasw>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-26 16:56:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomas Winkler 2000-10-19 11:25:29 UTC
The code is checking if the group in the list is  a number or a name
of the group, but in the case it's number it is not inserted into the
result list.  I've also added a , as a possible list separator. Bellow is
the patch:


--- /usr/src/redhat/SOURCES/glibc-2.1.94/hesiod/nss_hesiod/hesiod-grp.c
Mon Jul 24 16:23:29 2000
+++ hesiod-grp.c        Wed Oct 18 03:43:22 2000
@@ -224,7 +224,7 @@
       status = NSS_STATUS_NOTFOUND;
 
       q = p;
-      while (*q != '\0' && *q != ':')
+      while (*q != '\0' && *q != ':' && *q != ',')
        ++q;
 
       if (*q != '\0')
@@ -233,8 +233,11 @@
       val = strtol (p, &endp, 10);
       if (sizeof (gid_t) == sizeof (long int) || (gid_t) val == val)
        {
-         if (*endp == '\0' && endp != p)
-           status = NSS_STATUS_SUCCESS;
+         if (*endp == '\0' && endp != p) 
+           {
+             status = NSS_STATUS_SUCCESS;
+             group = val;
+           }
          else
            status = internal_gid_from_group (context, p, &group);

Comment 1 Jakub Jelinek 2000-10-20 11:53:29 UTC
Ulrich Drepper will be looking into this.

Comment 2 Jakub Jelinek 2000-10-26 16:56:24 UTC
Thanks, the patch is in glibc and will appear in the next glibc errata.