mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 19:32:31 +00:00 
			
		
		
		
	Use correct non-root user for REST API nodeshell method
This commit is contained in:
		| @@ -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]); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user