From 492305799be8fc492f6b5914f4d7c52ce19e6bab Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 22 Mar 2012 13:52:39 +0000 Subject: [PATCH] Fix psh to update homedirectory in event of sudo git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11946 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/psh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-client/bin/psh b/xCAT-client/bin/psh index 6aac43e8f..80e3d65fb 100755 --- a/xCAT-client/bin/psh +++ b/xCAT-client/bin/psh @@ -44,11 +44,13 @@ if ($::NONODECHECK) { @nodes=split(/,/, $noderange); } else { + my @user = getpwuid($>); + my $homedir=$user[7]; my $client = IO::Socket::SSL->new( PeerAddr=>$xcathost, - SSL_key_file=>$ENV{HOME}."/.xcat/client-cred.pem", - SSL_cert_file=>$ENV{HOME}."/.xcat/client-cred.pem", - SSL_ca_file => $ENV{HOME}."/.xcat/ca.pem", + SSL_key_file=>$homedir."/.xcat/client-cred.pem", + SSL_cert_file=>$homedir."/.xcat/client-cred.pem", + SSL_ca_file => $homedir."/.xcat/ca.pem", SSL_use_cert => 1, #SSL_verify_mode => 1, );