diff --git a/xCAT-server/share/xcat/scripts/configBNT b/xCAT-server/share/xcat/scripts/configBNT index 328acd16d..7fbf4ec59 100755 --- a/xCAT-server/share/xcat/scripts/configBNT +++ b/xCAT-server/share/xcat/scripts/configBNT @@ -67,6 +67,13 @@ if ($::HELP) exit(0); } +my $current_usr = getpwuid($>); +if ($current_usr ne "root") +{ + print "Can't run this command for non-root user\n"; + exit(1); +} + my $switchestab; my $switchhash; my $passwdtab; diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 6a085abf6..4c6010574 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -62,6 +62,13 @@ if ($::HELP) exit(0); } +my $current_usr = getpwuid($>); +if ($current_usr ne "root") +{ + print "Can't run this command for non-root user\n"; + exit(1); +} + if ($::SWITCH) { my @filternodes = xCAT::NodeRange::noderange( $::SWITCH ); diff --git a/xCAT-server/share/xcat/scripts/configonie b/xCAT-server/share/xcat/scripts/configonie index b47aa0957..3d7494af7 100755 --- a/xCAT-server/share/xcat/scripts/configonie +++ b/xCAT-server/share/xcat/scripts/configonie @@ -61,6 +61,13 @@ if ($::HELP) exit(0); } +my $current_usr = getpwuid($>); +if ($current_usr ne "root") +{ + print "Can't run this command for non-root user\n"; + exit(1); +} + if ($::SWITCH) { my @filternodes = xCAT::NodeRange::noderange( $::SWITCH ); if (nodesmissed) {