Commit bacd9230 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor SFS fixex and tweaks.

parent 39f59df9
......@@ -144,6 +144,19 @@ sub os_useradd($$$$$$$$)
return 0;
}
#
# Create a directory including all intermediate directories.
#
sub os_mkdir($$)
{
my ($dir, $mode) = @_;
if (system("$MKDIR -p -m $mode $dir")) {
return 0;
}
return 1;
}
#
# OS dependent, routing-related commands
#
......
......@@ -137,6 +137,19 @@ sub os_useradd($$$$$$$$)
}
#
# Create a directory including all intermediate directories.
#
sub os_mkdir($$)
{
my ($dir, $mode) = @_;
if (system("$MKDIR -p -m $mode $dir")) {
return 0;
}
return 1;
}
#
# OS dependent, routing-related commands
#
......
......@@ -52,6 +52,28 @@ use libsetup;
#
sub killvnode();
#
# Must be root.
#
if ($EUID != 0) {
die("*** $0:\n".
" Must be root! Maybe not installed properly?\n");
}
#
# If not invoked as real root, then must be invoked as emulabman.
#
if ($UID) {
my ($pwname) = getpwuid($UID) or
die("*** $0:\n".
" $UID is not in the password file!\n");
if ($pwname ne "emulabman") {
die("*** $0:\n".
" You do not have permission to run this script!\n");
}
}
#
# Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments.
......@@ -68,7 +90,7 @@ if (@ARGV != 1) {
}
my $vnodeid = $ARGV[0];
if ($vnodeid =~ /^([\w]+)$/) {
if ($vnodeid =~ /^([-\w]+)$/) {
$vnodeid = $1;
}
else {
......
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