source: patches/shadow-4.0.18.2-useradd_fix-2.patch@ 10de248

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 10de248 was 65850c02, checked in by Jim Gifford <clfs@…>, 17 years ago

Updated shadow patch. Better Patch

  • Property mode set to 100644
File size: 1.3 KB
  • shadow-4.0.18.2

    Submitted By: Jim Gifford (patches at jg555 dot com)
    Date: 2007-10-29
    Initial Package Version: 4.0.18.2
    Origin: Jim Gifford
    Upstream Status: Submitted
    Description: Fixes usersadd issue
     
    diff -Naur shadow-4.0.18.2.orig/src/useradd.c shadow-4.0.18.2/src/useradd.c
    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,
     
    210214                         grname);
    211215                exit (E_BAD_ARG);
    212216        }
    213         return getgrnam (grname);
     217        return getgrgid (gid);
    214218}
    215219
    216220static long get_number (const char *numstr)
  • shadow-4.0.18.2

    diff -Naur shadow-4.0.18.2.orig/src/usermod.c shadow-4.0.18.2/src/usermod.c
    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 (*grname != '\0' && *errptr == '\0' && errno != ERANGE && val >= 0)
    170174                return getgrgid (val);
    171         return getgrnam (grname);
     175        return getgrgid (val);
    172176}
    173177
    174178/*
Note: See TracBrowser for help on using the repository browser.