X-Git-Url: http://git.ieval.ro/?p=gruntmaster-daemon.git;a=blobdiff_plain;f=gruntmaster-exec;h=0a2c50c204c12477cd93d574353fe3a7bdeb80bd;hp=8ab857b2c469504182859214d6d2ab402489b5fc;hb=42ce8ba99a9d50c8bb440451f45098a98769216a;hpb=6f7e6b072e24d3464b18d4768a3da52ee15b8565 diff --git a/gruntmaster-exec b/gruntmaster-exec index 8ab857b..0a2c50c 100755 --- a/gruntmaster-exec +++ b/gruntmaster-exec @@ -28,7 +28,7 @@ use POSIX qw//; 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( @@ -37,12 +37,12 @@ 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'; @@ -89,7 +89,7 @@ if ($ret) { %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;