X-Git-Url: http://git.ieval.ro/?p=gruntmaster-daemon.git;a=blobdiff_plain;f=gruntmaster-exec;h=8ab857b2c469504182859214d6d2ab402489b5fc;hp=46ac491a674ebb1eb3672783e913d1f08e6d8a30;hb=6f7e6b072e24d3464b18d4768a3da52ee15b8565;hpb=d9ea4614aeddad7f8235a73ce3256bdce2b17811 diff --git a/gruntmaster-exec b/gruntmaster-exec index 46ac491..8ab857b 100755 --- a/gruntmaster-exec +++ b/gruntmaster-exec @@ -18,9 +18,6 @@ use constant +{ DIED => 5, REJ => 10, }; -# These constants are changed by ex/makevm -use constant USER => 65534; -use constant GROUP => 65534; use BSD::Resource qw/setrlimit RLIMIT_AS RLIMIT_FSIZE RLIMIT_NPROC/; use IPC::Signal qw/sig_name sig_num/; @@ -59,12 +56,12 @@ if ($ret) { } $tle = 1 }; - alarm ($timeout || 5); + alarm ($timeout || 10); waitpid $ret, 0; alarm 0; if (@sudo) { $? = $? >> 8; - $? = $? < 128 ? ($? << 8) : $? - 128; + $? = $? < 128 || $? > 128+32 ? ($? << 8) : $? - 128; } my $sig = $? & 127; my $signame = sig_name $sig; @@ -93,8 +90,6 @@ if ($ret) { 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; - POSIX::setgid $nobody ? 65534 : USER; - POSIX::setuid $nobody ? 65534 : GROUP; unshift @ARGV, @sudo; say STDERR "Executing: ", join ' ', map { "'$_'" } @ARGV if $debug; exec @ARGV;