From bc6de8f5a894ec83966654c9ae8c048830bfac04 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 2 Dec 2004 09:15:04 +0000 Subject: - any::enableShadow() -> authentication::enable_shadow() - inline authentication::crypt() --- perl-install/authentication.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'perl-install/authentication.pm') 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 { -- cgit v1.2.1