-Fix for zapping of image provided shadow file

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1782 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-06-26 15:41:34 +00:00
parent 6b11a47249
commit 9b91ca6563

View File

@ -94,11 +94,19 @@ sub process_request {
if ($pent and defined ($pent->{password})) {
my $pass = $pent->{password};
my $shadow;
open($shadow,"<","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/shadow");
my @shadents = <$shadow>;
close($shadow);
open($shadow,">","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/shadow");
unless ($pass =~ /^\$1\$/) {
$pass = crypt($pass,'$1$'.genpassword(8));
}
print $shadow "root:$pass:13880:0:99999:7:::\n";
foreach (@shadents) {
unless (/^root:/) {
print $shadow "$_";
}
}
close($shadow);
}
}