From 536944b9035ac39200a4952d28f692188f8852be Mon Sep 17 00:00:00 2001 From: nott Date: Sat, 7 Mar 2009 19:32:20 +0000 Subject: [PATCH] Add root password for AIX nodes git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2853 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Postage.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/perl-xCAT/xCAT/Postage.pm b/perl-xCAT/xCAT/Postage.pm index 14c401c85..ac5ece9cb 100644 --- a/perl-xCAT/xCAT/Postage.pm +++ b/perl-xCAT/xCAT/Postage.pm @@ -198,6 +198,27 @@ sub makescript { push @scriptd, "export SVLOGLOCAL\n"; } + # add the root passwd, if any, for AIX nodes + # get it from the system/root entry in the passwd table + # !!!!! it must be an unencrypted value for AIX!!!! + # - user will have to reset if this is a security issue + $os =~ s/\s*$//; + $os =~ tr/A-Z/a-z/; # Convert to lowercase + if ($os eq "aix") { + my $passwdtab = xCAT::Table->new('passwd'); + unless ( $passwdtab) { + my $rsp; + push @{$rsp->{data}}, "Unable to open passwd table."; + xCAT::MsgUtils->message("E", $rsp, $callback); + } + + my $et = $passwdtab->getAttribs({key => 'system', username => 'root'}, 'password'); + if ($et and defined ($et->{'password'})) { + push @scriptd, "ROOTPW=".$et->{'password'}."\n"; + push @scriptd, "export ROOTPW\n"; + } + } + if (!$nodesetstate) { $nodesetstate=getnodesetstate($node);} push @scriptd, "NODESETSTATE=".$nodesetstate."\n"; push @scriptd, "export NODESETSTATE\n";