From cac77c66f8f2f72a62c199e90c2a601d34625573 Mon Sep 17 00:00:00 2001 From: damien Date: Thu, 11 Jan 2001 15:54:30 +0000 Subject: updated --- perl-install/install_steps.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'perl-install/install_steps.pm') diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index b07443235..b6d885a78 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -603,6 +603,27 @@ sub setRootPassword($) { print F $_; } } +sub setAdminPassword($) { + my ($o) = @_; + my $p = $o->{prefix}; + my $u = $o->{adminuser} ||= {}; + + $u->{pw} ||= $u->{password} && any::crypt($u->{password}, $o->{authentication}{md5}); + + my @lines = cat_(my $f = "$p/etc/passwd") or log::l("missing passwd file"), return; + + local *F; + open F, "> $f" or die "failed to write file $f: $!\n"; + foreach (@lines) { + if (/^admin:/) { + chomp; + my %l; @l{@etc_pass_fields} = split ':'; + add2hash($u, \%l); + $_ = join(':', @$u{@etc_pass_fields}) . "\n"; + } + print F $_; + } +} #------------------------------------------------------------------------------ -- cgit v1.2.1