-Add retrieval of root's xCAT client credentials to credentials plugin

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1075 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-04-15 21:05:08 +00:00
parent e0b8c88da5
commit 1bf52722b1

View File

@ -99,20 +99,28 @@ sub process_request
my $tmpfile;
my @filecontent;
my $retdata;
my $tfilename;
foreach (@params_to_return) {
if (/ssh_root_key/) {
unless (-r "/root/.ssh/id_rsa") {
push @{$rsp->{'error'}},"Unable to read root's private ssh key";
next;
}
open($tmpfile,"/root/.ssh/id_rsa");
@filecontent=<$tmpfile>;
close($tmpfile);
$retdata = "\n".join('',@filecontent);
push @{$rsp->{'data'}},{content=>[$retdata],desc=>[$_]};
$retdata="";
@filecontent=();
$tfilename = "/root/.ssh/id_rsa";
} elsif (/xcat_root_cred/) {
unless (-r "/root/.xcat/client-cred.pem") {
push @{$rsp->{'error'}},"Unable to read root's private xCAT key";
next;
}
$tfilename = "/root/.xcat/client-cred.pem";
}
open($tmpfile,$tfilename);
@filecontent=<$tmpfile>;
close($tmpfile);
$retdata = "\n".join('',@filecontent);
push @{$rsp->{'data'}},{content=>[$retdata],desc=>[$_]};
$retdata="";
@filecontent=();
}
xCAT::MsgUtils->message("D", $rsp, $callback, 0);
return;