From 89a683b796c9e2612759e885c6f058ada5d13a1b Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 23 Aug 2012 18:20:17 +0000 Subject: [PATCH] Let internal env variable override, still getting hostnames in request->{username} git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13592 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/xdsh.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xdsh.pm b/xCAT-server/lib/xcat/plugins/xdsh.pm index 6a3538c18..6a7c6fe8b 100644 --- a/xCAT-server/lib/xcat/plugins/xdsh.pm +++ b/xCAT-server/lib/xcat/plugins/xdsh.pm @@ -695,10 +695,13 @@ sub process_request my ($var, $value) = split(/=/, $envar, 2); $ENV{$var} = $value; } + # if DSH_FROM_USERID does not exist, set for internal calls # if request->{username} exists, set DSH_FROM_USERID to it # override input, this is what was authenticated - if (($request->{username}) && defined($request->{username}->[0])) { - $ENV{DSH_FROM_USERID} = $request->{username}->[0]; + if (!($ENV{'DSH_FROM_USERID'})) { + if (($request->{username}) && defined($request->{username}->[0])) { + $ENV{DSH_FROM_USERID} = $request->{username}->[0]; + } } if ($command eq "xdsh") {