diff options
author | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-03-08 22:51:29 +0100 |
---|---|---|
committer | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-03-08 23:40:29 +0100 |
commit | 72f37ec25b76a1c195bb75219eefa43cad228caa (patch) | |
tree | b83482bbb94eaed0c674644bce6c0a9e1edd2970 | |
parent | 3c749d747438afce2a420000c474e7bc3164a7be (diff) |
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.
-rw-r--r-- | 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; |