summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index a7ae9c7..abb047d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -296,6 +296,16 @@ change_user (const char *program)
exit (EX_NOPERM);
}
+#ifdef HAVE_SETGROUPS
+ /* Drop all supplementary groups, otherwise these are inherited from the calling process */
+ if (setgroups (0, NULL) < 0) {
+ fprintf (stderr,
+ "%s: Unable to drop supplementary groups.\n",
+ program);
+ exit (EX_NOPERM);
+ }
+#endif
+
log_message (LOG_INFO, "Now running as group \"%s\".",
config.group);
}