2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-20 18:20:27 +00:00

Add WARNING message if non-root user runs chtab command

This commit is contained in:
Casandra Qiu
2018-05-30 13:41:25 -04:00
parent f10d33f66c
commit d49664ea31

View File

@@ -63,6 +63,12 @@ unless ($target) {
exit(1);
}
my $current_userid = getpwuid($>);
if ($current_userid ne "root")
{
print "WARNING: chtab worked without passing xcatd, using tabch command instead if user is controled by policy mechanism\n";
}
my %keyhash = ();
my @keypairs = split(/,/, $target);
if ($keypairs[0] !~ /([^\.\=]+)\.([^\.\=]+)\=(.+)/) {