From 92cdad2a2df25f55229aba05de6dac32f9b458d2 Mon Sep 17 00:00:00 2001 From: sjing Date: Tue, 24 Apr 2012 01:50:26 +0000 Subject: [PATCH] the fix for bug 3364300 - not display passwords in xcat commands or logs. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12313 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCenergy.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/perl-xCAT/xCAT/PPCenergy.pm b/perl-xCAT/xCAT/PPCenergy.pm index b3b8433e6..976bdca93 100644 --- a/perl-xCAT/xCAT/PPCenergy.pm +++ b/perl-xCAT/xCAT/PPCenergy.pm @@ -270,9 +270,13 @@ sub renergy { return ([[$node, "Cannot get user:password for the node. Please check table 'ppchcp' or 'ppcdirect'.", -1]]); } + # secure passwd in verbose mode + my $tmpv = $verbose; + $verbose = 0; if ($verbose) { push @return_msg, [$node, "Attributes of $node:\n User=$user\n Password=$password\n CEC=$cec_name\n nodetype=$hw_type\n inithcp=$hcphost\n hcps=@hcps_ip\n hcptype=$hcp_type", 0]; } + $verbose = $tmpv; my $master = xCAT::Utils->get_site_Master(); my $masterip = xCAT::NetworkUtils->getipaddr($master); @@ -333,7 +337,12 @@ sub renergy { # Call the xCAT_cim_client to query or set the energy capabilities $cmd .= " 2>&1"; + + # secure passwd in verbose mode + my $tmpv = $::VERBOSE; + $::VERBOSE = 0; my @result = xCAT::Utils->runcmd("$cmd", -1); + $::VERBOSE = $tmpv; foreach my $line (@result) { chomp($line);