From: Marius Gavrilescu Date: Sat, 7 Feb 2015 11:54:38 +0000 (+0200) Subject: Rename the --nobody argument to --sudo X-Git-Tag: 5999.000_005~49 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=42ce8ba99a9d50c8bb440451f45098a98769216a;p=gruntmaster-daemon.git Rename the --nobody argument to --sudo --- 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; diff --git a/lib/Gruntmaster/Daemon/Format.pm b/lib/Gruntmaster/Daemon/Format.pm index 2b60139..227b141 100644 --- a/lib/Gruntmaster/Daemon/Format.pm +++ b/lib/Gruntmaster/Daemon/Format.pm @@ -72,7 +72,7 @@ sub mkrun{ 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};