2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-21 05:25:32 +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

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] !~ /([^\.\=]+)\.([^\.\=]+)\=(.+)/) {