--- shadow-4.0.18.1.orig/src/useradd.c 2006-08-25 11:57:00.202525241 +0200 +++ shadow-4.0.18.1/src/useradd.c 2006-08-25 11:57:26.106735752 +0200 @@ -206,11 +206,8 @@ char *errptr; 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); - } + if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && gid >= 0) + return getgrgid (gid); return getgrnam (grname); } Index: shadow-4.0.18.1/src/usermod.c =================================================================== --- shadow-4.0.18.1.orig/src/usermod.c 2006-08-25 11:57:18.938677504 +0200 +++ shadow-4.0.18.1/src/usermod.c 2006-08-25 11:57:26.114735817 +0200 @@ -167,11 +167,8 @@ char *errptr; 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); - } + if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && val >= 0) + return getgrgid (val); return getgrnam (grname); }