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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user