the fix for bug 3364300 - only allow root to run xcatbypass mode.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12323 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -126,6 +126,12 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML | ||||
|        if (!(defined($request->{username}))) { | ||||
|          $request->{username}->[0] = getpwuid($>); | ||||
|        } | ||||
|  | ||||
|        # only allow root to run | ||||
|        unless ($request->{username}->[0] =~ /root/) { | ||||
|          print ("WARNING: Only allow root to run XCATBYPASS mode, your current user ID is $request->{username}->[0].\n"); | ||||
|          return 0; | ||||
|        } | ||||
|      } | ||||
|    # Load plugins from either specified or default dir | ||||
|     require xCAT::Table; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user