summaryrefslogtreecommitdiffstats
path: root/perl-install/authentication.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-25 14:27:56 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-25 14:27:56 +0000
commit9cf328b21c1e39f6071146ad30aaf317b93882d5 (patch)
treecf698130616d960e70911412002a5fb307e2f657 /perl-install/authentication.pm
parent1ceedccb6b1023339ada475c2495f9982cdd45e0 (diff)
downloaddrakx-9cf328b21c1e39f6071146ad30aaf317b93882d5.tar
drakx-9cf328b21c1e39f6071146ad30aaf317b93882d5.tar.gz
drakx-9cf328b21c1e39f6071146ad30aaf317b93882d5.tar.bz2
drakx-9cf328b21c1e39f6071146ad30aaf317b93882d5.tar.xz
drakx-9cf328b21c1e39f6071146ad30aaf317b93882d5.zip
- adduserdrake
o force the password to be utf8 (#23273) (that's what userdrake do)
Diffstat (limited to 'perl-install/authentication.pm')
-rw-r--r--perl-install/authentication.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/perl-install/authentication.pm b/perl-install/authentication.pm
index e292639f4..c4c7d4884 100644
--- a/perl-install/authentication.pm
+++ b/perl-install/authentication.pm
@@ -720,6 +720,9 @@ sub salt {
sub user_crypted_passwd {
my ($u, $isMD5) = @_;
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));
} else {
$u->{pw} || '';