diff --git a/xCAT-server/lib/xcat/plugins/xdsh.pm b/xCAT-server/lib/xcat/plugins/xdsh.pm index 187e206a1..0ffed07aa 100644 --- a/xCAT-server/lib/xcat/plugins/xdsh.pm +++ b/xCAT-server/lib/xcat/plugins/xdsh.pm @@ -1226,14 +1226,19 @@ sub process_request $ENV{$var} = $value; } - # if DSH_FROM_USERID does not exist, set for internal calls - # if request->{username} exists, set DSH_FROM_USERID to it + # if DSH_FROM_USERID or DSH_TO_USERID do not exist, set for internal calls + # if request->{username} exists, set DSH_FROM_USERID and DSH_TO_USERID to it # override input, this is what was authenticated if (!($ENV{'DSH_FROM_USERID'})) { if (($request->{username}) && defined($request->{username}->[0])) { $ENV{DSH_FROM_USERID} = $request->{username}->[0]; } } + if (!($ENV{'DSH_TO_USERID'})) { + if (($request->{username}) && defined($request->{username}->[0])) { + $ENV{DSH_TO_USERID} = $request->{username}->[0]; + } + } if ($command eq "xdsh") { xdsh($nodes, $args, $callback, $command, $request->{noderange}->[0]);