]> granicus.if.org Git - shadow/commitdiff
Make usermod -d and -m work independant of the argument order. Thanks to
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 17 Nov 2007 14:21:05 +0000 (14:21 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 17 Nov 2007 14:21:05 +0000 (14:21 +0000)
Justin Pryzby <jpryzby+d@quoininc.com> for the patch. This fixes Debian's
bug #451518.

ChangeLog
src/usermod.c

index fca0c16aacf1503acb0b605ff65fc38dadf11e77..5e24ffc83d99f506aa1068b86a3e692afa32dc14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 916483d2906045c214f5168c95ef15832495474a..61a9acf0cb4677fed8486843e44017525e0926a3 100644 (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;