--- src/useradd.c.orig Fri Jul 28 10:42:48 2006 +++ src/useradd.c Wed Aug 30 20:08:27 2006 @@ -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) --- src/usermod.c.orig Fri Jul 28 10:42:48 2006 +++ src/usermod.c Wed Aug 30 20:08:27 2006 @@ -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); } /*