--- shadow-4.0.18.1.orig/src/useradd.c 2006-07-28 19:42:48.000000000 +0200 +++ shadow-4.0.18.1/src/useradd.c 2006-08-04 09:24:34.000000000 +0200 @@ -203,13 +203,17 @@ long gid; char *errptr; + struct group* grp = getgrnam (grname); + if (grp) + return grp; + gid = strtol (grname, &errptr, 10); if (*errptr || errno == ERANGE || gid < 0) { fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog, grname); exit (E_BAD_ARG); } - return getgrnam (grname); + return getgrgid (gid); } static long get_number (const char *numstr) --- shadow-4.0.18.1.orig/src/usermod.c 2006-07-28 19:42:48.000000000 +0200 +++ shadow-4.0.18.1/src/usermod.c 2006-08-04 09:24:21.000000000 +0200 @@ -165,13 +165,17 @@ long val; char *errptr; + struct group* grp = getgrnam (grname); + if (grp) + return grp; + val = strtol (grname, &errptr, 10); if (*errptr || errno == ERANGE || val < 0) { fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog, grname); exit (E_BAD_ARG); } - return getgrnam (grname); + return getgrgid (val); } /*