summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 {