]> granicus.if.org Git - shadow/commitdiff
* Reset oflg with uflg if the new UID is equal to
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 10 Feb 2008 21:35:17 +0000 (21:35 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 10 Feb 2008 21:35:17 +0000 (21:35 +0000)
  the old one.
* Reset mflg with dflg if the new home directory is
  the same as the old one.

ChangeLog
src/usermod.c

index 5d5929bde1429a72793d45f2bb5fa7e07605228e..a2af5ffd396e8b90366d84915511dd768cea2f80 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-02-10  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/usermod.c: Reset oflg with uflg if the new UID is equal to
+       the old one.
+       * src/usermod.c: Reset mflg with dflg if the new home directory is
+       the same as the old one.
+
 2008-02-10  Nicolas François  <nicolas.francois@centraliens.net>
 
        * NEWS, src/usermod.c: Fix the handling of -a when a user is being
index 1ff4fc8682004bcf385267d5770ad4f56de04742..8ea613fb0cb2fa96a24054c4a61da1cfaa72f3f1 100644 (file)
@@ -967,6 +967,7 @@ static void process_flags (int argc, char **argv)
 
        if (user_newid == user_id) {
                uflg = 0;
+               oflg = 0;
        }
        if (user_newgid == user_gid) {
                gflg = 0;
@@ -985,6 +986,7 @@ static void process_flags (int argc, char **argv)
        }
        if (strcmp (user_newhome, user_home) == 0) {
                dflg = 0;
+               mflg = 0;
        }
        if (strcmp (user_newcomment, user_comment) == 0) {
                cflg = 0;
@@ -1039,12 +1041,6 @@ static void process_flags (int argc, char **argv)
                exit (E_USAGE);
        }
 
-       if (dflg && strcmp (user_home, user_newhome) == 0)
-               dflg = mflg = 0;
-
-       if (uflg && user_id == user_newid)
-               uflg = oflg = 0;
-
        /* local, no need for xgetpwnam */
        if (lflg && getpwnam (user_newname)) {
                fprintf (stderr, _("%s: user %s exists\n"), Prog, user_newname);