rmacct-ctrl_wrapper 574 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/usr/local/bin/perl -wT


# Wrapper for running rmacct-ctrl from the web page. See comment in
# mkprojdir-wrapper for logic.

# un-taint path
$ENV{'PATH'} = '/bin:/usr/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};

#
# Check args.
#
if ($#ARGV < 0) {
    die("Usage: rmacct-ctrl_wrapper <target_uid>\n");
}
my $target_uid = $ARGV[0];

#
# Untaint the argument.
#
if ($target_uid =~ /^([A-Z0-9-]+)$/i) {
    $target_uid = $1;
} else {
    die("Invalid target_uid; '$target_uid' contains illegal characters.\n");
}

exec "/usr/testbed/bin/rmacct-ctrl $target_uid";