Make usermod -d and -m work independant of the argument order. Thanks to

Justin Pryzby <jpryzby+d@quoininc.com> for the patch. This fixes Debian's
bug #451518.
This commit is contained in:
nekral-guest 2007-11-17 14:21:05 +00:00
parent 4aafb131ca
commit 71392cdc8f
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2007-11-17 Nicolas François <nicolas.francois@centraliens.net>
* src/usermod.c: Make usermod -d and -m work independant of the
argument order. Thanks to Justin Pryzby <jpryzby+d@quoininc.com>
for the patch. This fixes Debian's bug #451518.
2007-11-17 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, lib/nscd.c: Execute nscd -i instead of using the private

View File

@ -987,9 +987,6 @@ static void process_flags (int argc, char **argv)
Lflg++;
break;
case 'm':
if (!dflg)
usage ();
mflg++;
break;
case 'o':
@ -1059,6 +1056,14 @@ static void process_flags (int argc, char **argv)
exit (E_USAGE);
}
if (mflg && !dflg) {
fprintf (stderr,
_("%s: -m flag is ONLY allowed with the -d flag\n"),
Prog);
usage ();
exit (E_USAGE);
}
if (dflg && strcmp (user_home, user_newhome) == 0)
dflg = mflg = 0;