source: patches/shadow-4.0.18.1-useradd_fix-1.patch@ 38f82f9

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 38f82f9 was e5cfd75, checked in by Jim Gifford <clfs@…>, 18 years ago

Added: shadow-4.0.18.1-useradd_fix-1.patch

  • Property mode set to 100644
File size: 1.2 KB
  • shadow-4.0.18.1

    Submitted By: Jim Gifford (patches at jg555 dot com)
    Date: 2006-08-10
    Initial Package Version: 4.0.18.1
    Origin: Jim Gifford
    Upstream Status: Submitted
    Description: Fixes usersadd issue
     
    old new  
    203203        long gid;
    204204        char *errptr;
    205205
     206        struct group* grp = getgrnam (grname);
     207        if (grp)
     208                return grp;
     209
    206210        gid = strtol (grname, &errptr, 10);
    207211        if (*errptr || errno == ERANGE || gid < 0) {
    208212                fprintf (stderr,
    209213                         _("%s: invalid numeric argument '%s'\n"), Prog, grname);
    210214                exit (E_BAD_ARG);
    211215        }
    212         return getgrnam (grname);
     216        return getgrgid (gid);
    213217}
    214218
    215219static long get_number (const char *numstr)
  • shadow-4.0.18.1

    old new  
    165165        long val;
    166166        char *errptr;
    167167
     168        struct group* grp = getgrnam (grname);
     169        if (grp)
     170                return grp;
     171
    168172        val = strtol (grname, &errptr, 10);
    169173        if (*errptr || errno == ERANGE || val < 0) {
    170174                fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog,
    171175                         grname);
    172176                exit (E_BAD_ARG);
    173177        }
    174         return getgrnam (grname);
     178        return getgrgid (val);
    175179}
    176180
    177181/*
Note: See TracBrowser for help on using the repository browser.