From 5b53b638f303e55819e1e2f9250e5c3520185dd2 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 15 Mar 2010 15:50:16 +0000 Subject: [PATCH] override DSH_FROM_USERID with autheticated id in request->{username}, if it exists git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5475 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/xdsh.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/xdsh.pm b/xCAT-server/lib/xcat/plugins/xdsh.pm index 14b780e97..67eabbfd4 100644 --- a/xCAT-server/lib/xcat/plugins/xdsh.pm +++ b/xCAT-server/lib/xcat/plugins/xdsh.pm @@ -529,6 +529,11 @@ sub process_request my ($var, $value) = split(/=/, $envar, 2); $ENV{$var} = $value; } + # 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 ($command eq "xdsh") { xdsh($nodes, $args, $callback, $command, $request->{noderange}->[0]);