hostkey check must be in both the /install/postscript/hostkey and the /etc/xcat/hostkey directory

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3336 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2009-05-11 12:27:30 +00:00
parent a035f982d4
commit 1ba8689d21

View File

@ -3859,6 +3859,40 @@ sub checkCredFiles
$rsp->{data}->[0] = "Error: $dir is missing.";
xCAT::MsgUtils->message("I", $rsp, $cb);
}
# ssh hostkeys
my $dir = "/etc/xcat/hostkeys";
if (-d $dir)
{
my $file = "$dir/ssh_host_key.pub";
if (-e $file)
{
my $file2 = "$dir/*.pub"; # all public keys
my $cmd = "/bin/chmod 0644 $file2";
my $outref = xCAT::Utils->runcmd("$cmd", 0);
if ($::RUNCMD_RC != 0)
{
my $rsp = {};
$rsp->{data}->[0] = "Error on command: $cmd";
xCAT::MsgUtils->message("I", $rsp, $cb);
}
}
else
{ # hostkey missing
my $rsp = {};
$rsp->{data}->[0] = "Error: $file is missing.";
xCAT::MsgUtils->message("I", $rsp, $cb);
}
}
else
{
my $rsp = {};
$rsp->{data}->[0] = "Error: $dir is missing.";
xCAT::MsgUtils->message("I", $rsp, $cb);
}
# ssh directory
my $dir = "/install/postscripts/_ssh";
# ssh directory
my $dir = "/install/postscripts/_ssh";