summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-08-22 15:55:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-08-22 15:55:21 +0000
commitcb332379273b831b0f6355940dd41202f2e0d2fb (patch)
tree0a285d7cc62e4bd12e865ef6961160b794b73720
parent78c35fcaf183be19aafecb3a5415fbbfa6cd1eb4 (diff)
downloaddrakx-cb332379273b831b0f6355940dd41202f2e0d2fb.tar
drakx-cb332379273b831b0f6355940dd41202f2e0d2fb.tar.gz
drakx-cb332379273b831b0f6355940dd41202f2e0d2fb.tar.bz2
drakx-cb332379273b831b0f6355940dd41202f2e0d2fb.tar.xz
drakx-cb332379273b831b0f6355940dd41202f2e0d2fb.zip
- handle blowfish password encryption and use it by default (#42426)
-rw-r--r--perl-install/authentication.pm6
-rw-r--r--perl-install/install/NEWS1
-rw-r--r--perl-install/install/install2.pm2
3 files changed, 6 insertions, 3 deletions
diff --git a/perl-install/authentication.pm b/perl-install/authentication.pm
index 72656d447..886b45d15 100644
--- a/perl-install/authentication.pm
+++ b/perl-install/authentication.pm
@@ -260,6 +260,7 @@ sub check_given_password {
sub get() {
my $system_auth = cat_("/etc/pam.d/system-auth");
my $authentication = {
+ blowfish => to_bool($system_auth =~ /\$2a\$/),
md5 => to_bool($system_auth =~ /md5/),
shadow => to_bool($system_auth =~ /shadow/),
};
@@ -817,12 +818,13 @@ sub salt {
sub user_crypted_passwd {
my ($u, $authentication) = @_;
- my $isMD5 = !$authentication || $authentication->{md5};
if ($u->{password}) {
require utf8;
utf8::encode($u->{password}); #- we don't want perl to do "smart" things in crypt()
- crypt($u->{password}, $isMD5 ? '$1$' . salt(8) : salt(2));
+ crypt($u->{password},
+ !$authentication || $authentication->{blowfish} ? '$2a$08$' . salt(60) :
+ $authentication->{md5} ? '$1$' . salt(8) : salt(2));
} else {
$u->{pw} || '';
}
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 5083aeb48..565ba1c98 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,4 @@
+- handle blowfish password encryption and use it by default (#42426)
- allow to install bootloader on md0 (#42999)
(regression introduced on 2004-08-05)
diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm
index 6cc1c6e3d..8724fda52 100644
--- a/perl-install/install/install2.pm
+++ b/perl-install/install/install2.pm
@@ -38,7 +38,7 @@ $o = $::o = {
# bootloader => { linear => 0, message => 1, timeout => 5, restricted => 0 },
#- packages => [ qw() ],
partitioning => { clearall => 0, eraseBadPartitions => 0, auto_allocate => 0 }, #-, readonly => 0 },
- authentication => { md5 => 1, shadow => 1 },
+ authentication => { blowfish => 1, shadow => 1 },
locale => { lang => 'en_US' },
#- isUpgrade => 0,
toRemove => [],