summaryrefslogtreecommitdiffstats
path: root/perl-install
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
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')
-rw-r--r--perl-install/any.pm5
-rw-r--r--perl-install/authentication.pm14
2 files changed, 9 insertions, 10 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 7d362b166..29aeea8c4 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -100,11 +100,6 @@ sub add_users {
}
}
-sub enableShadow() {
- run_program::rooted($::prefix, "pwconv") or log::l("pwconv failed");
- run_program::rooted($::prefix, "grpconv") or log::l("grpconv failed");
-}
-
sub hdInstallPath() {
my $tail = first(readlink("/tmp/image") =~ m|^(?:/tmp/)?hdimage/*(.*)|);
my $head = first(readlink("/tmp/hdimage") =~ m|$::prefix(.*)|);
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 {