diff options
author | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-02-07 21:31:39 +0100 |
---|---|---|
committer | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-02-08 23:40:52 +0100 |
commit | a1f7308a9a05cfc1016c95ff5e511d6111b8d134 (patch) | |
tree | 786a83d08ed8e0e2c3bac26721f0f40acb1eefe9 | |
parent | d94c927ce12ee68fa9c90d56b3898b017941787b (diff) |
Remove obsolete function modify_shadow_password()
This is not used since we use platform tools to set password.
-rw-r--r-- | Users/Users.pm | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/Users/Users.pm b/Users/Users.pm index 523aa2a..4f4cb68 100644 --- a/Users/Users.pm +++ b/Users/Users.pm @@ -464,34 +464,6 @@ sub change_user_chfn &Utils::File::run (@command); } -# modifies /etc/shadow directly, not good practice, -# but better than passing clean passwords around -sub modify_shadow_password -{ - my ($login, $password) = @_; - my ($buffer, $i, @arr); - - $buffer = &Utils::File::load_buffer (@shadow_names); - return if (!$buffer); - $i = 0; - - while ($$buffer[$i]) - { - @arr = split ':', $$buffer[$i], -1; - - if ($arr[0] eq $login) - { - $arr[1] = $password; - $$buffer[$i] = join (':', @arr) . "\n"; - last; - } - - $i++; - } - - &Utils::File::save_buffer ($buffer, @shadow_names); -} - sub set_passwd { my ($login, $password) = @_; |