]> granicus.if.org Git - shadow/commitdiff
* src/usermod.c: Do not call usr_update() if it will have no
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 11 Jul 2008 21:50:05 +0000 (21:50 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 11 Jul 2008 21:50:05 +0000 (21:50 +0000)
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.

ChangeLog
NEWS
src/usermod.c

index 6a728a01390a541d6e606c2536da46f903b93a64..0407579bd2ff898322fcecdf9e9189f32472e026 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-11  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * 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  <nicolas.francois@centraliens.net>
 
        * src/usermod.c: Split update_files() into update_lastlog() and
diff --git a/NEWS b/NEWS
index 0e931f18ee3e5aca069a4e0c1c610f4918b1d73a..f521a77e873a7ec356ddd6b4928bca4a2cf71018 100644 (file)
--- 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
 
index 17bb35bdbcc93a56548b86ecd18d3d9365f5dda4..ec46ec990beccf6d760ee5d7fca1fec9ab1e5593 100644 (file)
@@ -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 ();
        }