mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-31 10:06:39 +00:00
Merge pull request #7083 from gurevichmark/rest_non_root
Use specified non-root user for REST API nodeshell method
This commit is contained in:
commit
c36e701af0
@ -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]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user