From: nekral-guest Date: Sun, 10 Feb 2008 21:35:17 +0000 (+0000) Subject: * Reset oflg with uflg if the new UID is equal to X-Git-Tag: 4.1.1~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1599d3d1289c49fdd866ee5c3a8ea262b2ce67ea;p=shadow * Reset oflg with uflg if the new UID is equal to the old one. * Reset mflg with dflg if the new home directory is the same as the old one. --- diff --git a/ChangeLog b/ChangeLog index 5d5929bd..a2af5ffd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-10 Nicolas François + + * 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 * NEWS, src/usermod.c: Fix the handling of -a when a user is being diff --git a/src/usermod.c b/src/usermod.c index 1ff4fc86..8ea613fb 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -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);