Make usermod -o and -u work independently of the argument order.

This commit is contained in:
nekral-guest 2007-11-17 14:40:54 +00:00
parent 488184394e
commit af045a0733
3 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2007-11-17 Nicolas François <nicolas.francois@centraliens.net>
* src/usermod.c: Make usermod -o and -u work independently of the
argument order.
2007-11-17 Nicolas François <nicolas.francois@centraliens.net>
* src/usermod.c: Validate that two of the -L, -p, and -U options
@ -6,7 +11,7 @@
2007-11-17 Nicolas François <nicolas.francois@centraliens.net>
* src/usermod.c: Make usermod -d and -m work independent of the
* src/usermod.c: Make usermod -d and -m work independently of the
argument order. Thanks to Justin Pryzby <jpryzby+d@quoininc.com>
for the patch. This fixes Debian's bug #451518.

1
NEWS
View File

@ -32,6 +32,7 @@ shadow-4.0.18.1 -> shadow-4.0.18.2 UNRELEASED
writing the passwd files.
- Flush the nscd tables using nscd -i instead of the private glibc socket.
(RedHat patches shadow-4.0.16-nscd.c and shadow-4.0.17-notInheritFd.patch)
- usermod: Make usermod options independent of the argument order.
shadow-4.0.18.1 -> shadow-4.0.18.2 28-10-2007

View File

@ -987,9 +987,6 @@ static void process_flags (int argc, char **argv)
mflg++;
break;
case 'o':
if (!uflg)
usage ();
oflg++;
break;
case 'p':
@ -1055,6 +1052,14 @@ static void process_flags (int argc, char **argv)
exit (E_USAGE);
}
if (oflg && !uflg) {
fprintf (stderr,
_("%s: -o flag is ONLY allowed with the -u flag\n"),
Prog);
usage ();
exit (E_USAGE);
}
if (mflg && !dflg) {
fprintf (stderr,
_("%s: -m flag is ONLY allowed with the -d flag\n"),