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/branches/2.7@12324 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
sjing 2012-04-24 02:40:18 +00:00
parent 939d35a0fe
commit 34958c9a33

View File

@ -123,6 +123,11 @@ $request->{clienttype}->[0] = "cli"; # setup clienttype for auditlog
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;
my %cmd_handlers;