From: Marius Gavrilescu Date: Thu, 22 Jan 2015 21:48:23 +0000 (+0200) Subject: Drop privileges in gruntmaster-exec if possible X-Git-Tag: 5999.000_005~100 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=7be8c37d42b6782bc5d94ea4e52dd1261ce6e3ae;p=gruntmaster-daemon.git Drop privileges in gruntmaster-exec if possible --- diff --git a/gruntmaster-exec b/gruntmaster-exec index 49e915a..a4ae94d 100755 --- a/gruntmaster-exec +++ b/gruntmaster-exec @@ -64,6 +64,8 @@ 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; + POSIX::setgid 65534; # Set group id to nogroup + POSIX::setuid 65534; # Set user id to nobody exec @ARGV; }