Bug 19375 - hesiod/nss_hesiod/hesiod-grp.c (_nss_hesiod_initgroups_dyn)
hesiod/nss_hesiod/hesiod-grp.c (_nss_hesiod_initgroups_dyn)
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
7.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-19 07:25 EDT by Tomas Winkler
Modified: 2016-11-24 10:22 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-26 12:56:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomas Winkler 2000-10-19 07:25:29 EDT
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 07:53:29 EDT
Ulrich Drepper will be looking into this.
Comment 2 Jakub Jelinek 2000-10-26 12:56:24 EDT
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.