summaryrefslogtreecommitdiffstats
path: root/perl-install/authentication.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-08-22 15:40:00 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-08-22 15:40:00 +0000
commit231b6bd7b02a81a7383a8c407e7c90ba927692e2 (patch)
tree03eb0d63b2ab9c757cd4f0f131b566b330f7c369 /perl-install/authentication.pm
parentd1066453d3c10568473dbcb9d3aeb31ae9a66afd (diff)
downloaddrakx-231b6bd7b02a81a7383a8c407e7c90ba927692e2.tar
drakx-231b6bd7b02a81a7383a8c407e7c90ba927692e2.tar.gz
drakx-231b6bd7b02a81a7383a8c407e7c90ba927692e2.tar.bz2
drakx-231b6bd7b02a81a7383a8c407e7c90ba927692e2.tar.xz
drakx-231b6bd7b02a81a7383a8c407e7c90ba927692e2.zip
change prototype of any::create_user(), authentication::user_crypted_passwd(),
authentication::write_passwd_user(): pass $authentication instead of $isMD5 (for next commits)
Diffstat (limited to 'perl-install/authentication.pm')
-rw-r--r--perl-install/authentication.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/perl-install/authentication.pm b/perl-install/authentication.pm
index 48a7829e7..11a878bbe 100644
--- a/perl-install/authentication.pm
+++ b/perl-install/authentication.pm
@@ -259,8 +259,9 @@ sub check_given_password {
sub get() {
my $system_auth = cat_("/etc/pam.d/system-auth");
- my $authentication = {
- md5 => to_bool($system_auth =~ /md5/), shadow => to_bool($system_auth =~ /shadow/),
+ my $authentication = {
+ md5 => to_bool($system_auth =~ /md5/),
+ shadow => to_bool($system_auth =~ /shadow/),
};
my @pam_kinds = get_pam_authentication_kinds();
@@ -815,7 +816,8 @@ sub salt {
}
sub user_crypted_passwd {
- my ($u, $isMD5) = @_;
+ my ($u, $authentication) = @_;
+ my $isMD5 = $authentication->{md5};
if ($u->{password}) {
require utf8;
utf8::encode($u->{password}); #- we don't want perl to do "smart" things in crypt()
@@ -829,14 +831,14 @@ sub user_crypted_passwd {
sub set_root_passwd {
my ($superuser, $authentication) = @_;
$superuser->{name} = 'root';
- write_passwd_user($superuser, $authentication->{md5});
+ write_passwd_user($superuser, $authentication);
delete $superuser->{name};
}
sub write_passwd_user {
- my ($u, $isMD5) = @_;
+ my ($u, $authentication) = @_;
- $u->{pw} = user_crypted_passwd($u, $isMD5);
+ $u->{pw} = user_crypted_passwd($u, $authentication);
$u->{shell} ||= '/bin/bash';
substInFile {