diff options
Diffstat (limited to 'src/main/tools')
-rw-r--r-- | src/main/tools/process-wrapper.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/tools/process-wrapper.c b/src/main/tools/process-wrapper.c index a6c66012ae..7935555cbd 100644 --- a/src/main/tools/process-wrapper.c +++ b/src/main/tools/process-wrapper.c @@ -164,6 +164,15 @@ int main(int argc, char *argv[]) { } } + int gid = getgid(); + int egid = getegid(); + if (gid != egid) { + // Switch completely to the target gid. + if (setregid(egid, egid) != 0) { + DIE("changing gid failed: setregid"); + } + } + // Parse the cmdline args to get the timeout and redirect files. argv++; double timeout; |