From: nekral-guest Date: Fri, 11 Jul 2008 21:50:05 +0000 (+0000) Subject: * src/usermod.c: Do not call usr_update() if it will have no X-Git-Tag: 4.1.3~332 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22fb4fe019336f4ef9977b980ebe3f3d9b544dc0;p=thirdparty%2Fshadow.git * src/usermod.c: Do not call usr_update() if it will have no effects. This avoid checking if the user exists in the local passwd file if not necessary, and thus allow to add LDAP users to local groups. (The user is already checked against the system configuration with getpwnam()). Thanks to Dan Kopecek. --- diff --git a/ChangeLog b/ChangeLog index 6a728a013..0407579bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-07-11 Nicolas François + + * src/usermod.c: Do not call usr_update() if it will have no + effects. This avoid checking if the user exists in the local passwd + file if not necessary, and thus allow to add LDAP users to local + groups. (The user is already checked against the system + configuration with getpwnam()). Thanks to Dan Kopecek. + 2008-07-11 Nicolas François * src/usermod.c: Split update_files() into update_lastlog() and diff --git a/NEWS b/NEWS index 0e931f18e..f521a77e8 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ shadow-4.1.1 -> shadow-4.1.2 UNRELEASED *** general: - newusers * Implement the -r, --system option. +- usermod + * Allow adding LDAP users (or any user not present in the local passwd + file) to local groups shadow-4.1.1 -> shadow-4.1.2 25-05-2008 diff --git a/src/usermod.c b/src/usermod.c index 17bb35bdb..ec46ec990 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -1649,7 +1649,10 @@ int main (int argc, char **argv) * change the home directory, then close and update the files. */ open_files (); - usr_update (); + if ( cflg || dflg || eflg || fflg || gflg || Lflg || lflg || pflg + || sflg || uflg || Uflg) { + usr_update (); + } if (Gflg || lflg) { grp_update (); }