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

@@ -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"),