]> granicus.if.org Git - shadow/commitdiff
Make usermod -o and -u work independently of the argument order.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 17 Nov 2007 14:40:54 +0000 (14:40 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 17 Nov 2007 14:40:54 +0000 (14:40 +0000)
ChangeLog
NEWS
src/usermod.c

index 18bd0e00b30db79176c8d95ae661b5afade5ade1..fecce194bb553410376731521cf527ac5319dbaa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
 
diff --git a/NEWS b/NEWS
index 6e61c1544a0bb58c1ddcea26a9138d0810683cb0..5899bd04a59d532920f095daa7dd6d1a7a1b8f5a 100644 (file)
--- 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
 
index 78e596a29e8432a53be7a06118871bbfa1a0b6fb..a0bbab2b2a0a3d716deef87f2f1f5eadd07e0dfb 100644 (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"),