diff --git a/ChangeLog b/ChangeLog index 18bd0e00..fecce194 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-17 Nicolas François + + * src/usermod.c: Make usermod -o and -u work independently of the + argument order. + 2007-11-17 Nicolas François * src/usermod.c: Validate that two of the -L, -p, and -U options @@ -6,7 +11,7 @@ 2007-11-17 Nicolas François - * 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 for the patch. This fixes Debian's bug #451518. diff --git a/NEWS b/NEWS index 6e61c154..5899bd04 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/src/usermod.c b/src/usermod.c index 78e596a2..a0bbab2b 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -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"),