summaryrefslogtreecommitdiffstats
path: root/perl-install/authentication.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-12-02 09:15:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-12-02 09:15:04 +0000
commitbc6de8f5a894ec83966654c9ae8c048830bfac04 (patch)
tree5c76af8ad6cfea20a8caff89c1f0af9faaf03ce0 /perl-install/authentication.pm
parent83d312c018a06b03d442260f723b9654f3d219b4 (diff)
downloaddrakx-backup-do-not-use-bc6de8f5a894ec83966654c9ae8c048830bfac04.tar
drakx-backup-do-not-use-bc6de8f5a894ec83966654c9ae8c048830bfac04.tar.gz
drakx-backup-do-not-use-bc6de8f5a894ec83966654c9ae8c048830bfac04.tar.bz2
drakx-backup-do-not-use-bc6de8f5a894ec83966654c9ae8c048830bfac04.tar.xz
drakx-backup-do-not-use-bc6de8f5a894ec83966654c9ae8c048830bfac04.zip
- any::enableShadow() -> authentication::enable_shadow()
- inline authentication::crypt()
Diffstat (limited to 'perl-install/authentication.pm')
-rw-r--r--perl-install/authentication.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/perl-install/authentication.pm b/perl-install/authentication.pm
index 8aefb3286..6c911a7e1 100644
--- a/perl-install/authentication.pm
+++ b/perl-install/authentication.pm
@@ -186,7 +186,7 @@ sub set {
my $when_network_is_up = $o_when_network_is_up || sub { my ($f) = @_; $f->() };
- any::enableShadow() if $authentication->{shadow};
+ enable_shadow() if $authentication->{shadow};
my $kind = authentication::to_kind($authentication);
@@ -611,14 +611,18 @@ sub query_srv_names {
map { $_->target } $query->answer;
}
-sub crypt {
- my ($password, $md5) = @_;
- crypt($password, $md5 ? '$1$' . salt(8) : salt(2));
+sub enable_shadow() {
+ run_program::rooted($::prefix, "pwconv") or log::l("pwconv failed");
+ run_program::rooted($::prefix, "grpconv") or log::l("grpconv failed");
}
sub user_crypted_passwd {
my ($u, $isMD5) = @_;
- $u->{password} ? &crypt($u->{password}, $isMD5) : $u->{pw} || '';
+ if ($u->{password}) {
+ crypt($u->{password}, $isMD5 ? '$1$' . salt(8) : salt(2));
+ } else {
+ $u->{pw} || '';
+ }
}
sub set_root_passwd {