Allow non numerical group identifier to be specified with useradd's -g

option. Applied Debian patch 397_non_numerical_identifier. Thanks also to
Greg Schafer <gschafer@zip.com.au>.
This commit is contained in:
nekral-guest 2007-11-10 15:51:38 +00:00
parent 6a73df0b18
commit 6a051e1544
3 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2007-11-10 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, src/useradd.c: allow non numerical group identifier to be
specified with useradd's -g option. Applied Debian patch
397_non_numerical_identifier. Thanks also to Greg Schafer
<gschafer@zip.com.au>.
2007-10-28 Nicolas François <nicolas.francois@centraliens.net>
* configure.in: Prepare the next release: 4.0.18.2. The gettext

7
NEWS
View File

@ -1,5 +1,12 @@
$Id: NEWS,v 1.492 2007/02/01 20:49:25 kloczek Exp $
shadow-4.0.18.1 -> shadow-4.0.18.2 UNRELEASED
*** general:
- useradd: Allow non numerical group identifier to be specified with
useradd's -g option. Applied Debian patch 397_non_numerical_identifier.
Thanks also to Greg Schafer <gschafer@zip.com.au>.
shadow-4.0.18.1 -> shadow-4.0.18.2 28-10-2007
*** general:

View File

@ -204,12 +204,8 @@ static struct group *getgr_nam_gid (const char *grname)
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);
}