Bug 19375 - hesiod/nss_hesiod/hesiod-grp.c (_nss_hesiod_initgroups_dyn)
Summary: hesiod/nss_hesiod/hesiod-grp.c (_nss_hesiod_initgroups_dyn)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-19 11:25 UTC by Tomas Winkler
Modified: 2016-11-24 15:22 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-10-26 16:56:27 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.