use Text::ParseWords qw/shellwords/;
use Time::HiRes qw/alarm/;
-my (@fds, $timeout, $mlimit, $olimit, $nobody);
+my (@fds, $timeout, $mlimit, $olimit, $sudo);
my $close = 1;
GetOptions(
"mlimit=i" => \$mlimit,
"olimit=i" => \$olimit,
"close!" => \$close,
- "nobody!" => \$nobody,
+ "sudo!" => \$sudo,
);
my $killuser = $ENV{GRUNTMASTER_KILL_USER};
my @sudo;
-@sudo = (shellwords ($ENV{GRUNTMASTER_SUDO}), '--') if $ENV{GRUNTMASTER_SUDO} && $nobody;
+@sudo = (shellwords ($ENV{GRUNTMASTER_SUDO}), '--') if $ENV{GRUNTMASTER_SUDO} && $sudo;
undef $mlimit if @sudo; # sudo wants a lot of address space
my $ret = fork // die 'Cannot fork';
%ENV = (ONLINE_JUDGE => 1, PATH => $ENV{PATH}, HOME => $ENV{HOME});
setrlimit RLIMIT_AS, $mlimit, $mlimit or die $! if $mlimit;
setrlimit RLIMIT_FSIZE, $olimit, $olimit or die $! if $olimit;
- setrlimit RLIMIT_NPROC, $nproc, $nproc or die $! if $nobody;
+ setrlimit RLIMIT_NPROC, $nproc, $nproc or die $! if $sudo;
unshift @ARGV, @sudo;
say STDERR "Executing: ", join ' ', map { "'$_'" } @ARGV if $debug;
exec @ARGV;
my ($name, %args) = @_;
get_logger->trace("Running $name...");
my $basename = fileparse $name, qr/[.][^.]*/s;
- my @args = ('--nobody');
+ my @args = ('--sudo');
push @args, '--no-close' if $ENV{TEST_VERBOSE};
push @args, '--timeout', $args{timeout} if $args{timeout};
push @args, '--mlimit', $args{mlimit} if $args{mlimit};