[system-tools-backends-clone] Fix setting Real name and password for new users



commit 72f37ec25b76a1c195bb75219eefa43cad228caa
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Mon Mar 8 22:51:29 2010 +0100

    Fix setting Real name and password for new users
    
    We need to set Real name and password before reloading user from /etc/passwd. Else, we erase those fields, and never set it to the asked values.

 Users/Users.pm |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/Users/Users.pm b/Users/Users.pm
index 11b9c90..54dbece 100644
--- a/Users/Users.pm
+++ b/Users/Users.pm
@@ -645,6 +645,10 @@ sub add_user
     }
   }
 
+  &change_user_chfn ($$user[$LOGIN], undef, $$user[$COMMENT]);
+  &set_passwd ($$user[$LOGIN], $$user[$PASSWD], $$user[$PASSWD_STATUS]);
+  &set_lock ($$user[$LOGIN], $$user[$PASSWD_STATUS]);
+
   $chown_home = $$user[$HOME_FLAGS] & (1 << 1);
 
   # update user to get values that were filled
@@ -657,10 +661,6 @@ sub add_user
     &Utils::File::run (@command);
   }
 
-  &change_user_chfn ($$user[$LOGIN], undef, $$user[$COMMENT]);
-  &set_passwd ($$user[$LOGIN], $$user[$PASSWD], $$user[$PASSWD_STATUS]);
-  &set_lock ($$user[$LOGIN], $$user[$PASSWD_STATUS]);
-
   # Return the new user with default values filled.
   # Returns NULL if user doesn't exist, which means failure.
   return $user;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]