Commit d6f0fce2 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Make sure this script is not invoked as root. Makes no sense, and

avoids some security issues.
parent 01f90226
#!/usr/bin/perl -w -T #!/usr/bin/perl -w
# #
# wrapper for running linktest that includes # wrapper for running linktest that includes
# an extra event for reporting completion. # an extra event for reporting completion.
use strict; use strict;
use Getopt::Std; use Getopt::Std;
use English;
# security # security
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin'; $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
...@@ -17,6 +18,14 @@ sub usage { ...@@ -17,6 +18,14 @@ sub usage {
return 1; return 1;
} }
#
# This script should be run as a real person!
#
if (! $EUID) {
die("*** $0:\n".
" This script should not be run as root!\n");
}
# signal handler in case the process is killed. # signal handler in case the process is killed.
$SIG{INT} = sub { $SIG{INT} = sub {
print "Aborted. Linktest continues on nodes.\n"; print "Aborted. Linktest continues on nodes.\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment