From ad694905bee1f3f11b8849de42182ae31499e76b Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Tue, 16 Mar 2010 19:14:37 +0000 Subject: [PATCH] * src/usermod.c: user_newname and user_newid cannot be used to test if the username or ID is changed. lflg and uflg should be used instead. --- ChangeLog | 6 ++++++ src/usermod.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 18ffa42f..ea74360b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-03-15 Nicolas François + + * src/usermod.c: user_newname and user_newid cannot be used to + test if the username or ID is changed. lflg and uflg should be + used instead. + 2010-03-15 Nicolas François * src/userdel.c: Avoid perror. Give more verbose warnings. diff --git a/src/usermod.c b/src/usermod.c index 826b8d5d..ad98bb2f 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -1793,7 +1793,7 @@ int main (int argc, char **argv) close_files (); #ifdef WITH_TCB - if ( ((NULL != user_newname) || (user_newid != -1)) + if ( (lflg || uflg) && (!shadowtcb_move (user_newname, user_newid)) ) { exit (E_PW_UPDATE); }