]> iEval git - gruntmaster-daemon.git/commitdiff
Drop privileges in gruntmaster-exec if possible
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 22 Jan 2015 21:48:23 +0000 (23:48 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 22 Jan 2015 21:48:23 +0000 (23:48 +0200)
gruntmaster-exec

index 49e915a8d5cf131075170b7fcb6539ac1a3a4bd4..a4ae94d4ce0335575dd4dcfa50b7a208078a1a69 100755 (executable)
@@ -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;
 }
 
This page took 0.017083 seconds and 4 git commands to generate.