2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge pull request #5265 from cxhong/5260

Add WARNING message if non-root user runs chtab command
This commit is contained in:
Victor Hu 2018-06-01 14:41:13 -04:00 committed by GitHub
commit 000235dcf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,6 +63,12 @@ unless ($target) {
exit(1);
}
my $current_userid = getpwuid($>);
if ($current_userid ne "root")
{
print "WARNING: chtab bypasses xcatd and does not enforce xCAT policy tables. Consider using tabch instead.\n";
}
my %keyhash = ();
my @keypairs = split(/,/, $target);
if ($keypairs[0] !~ /([^\.\=]+)\.([^\.\=]+)\=(.+)/) {