about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-08-16 16:13:43 -0400
committerJune McEnroe <june@causal.agency>2020-08-16 16:13:43 -0400
commite381f7bbe31a7e0d7fc6155341ce0ce9828c54d3 (patch)
treeec67f84a352fc67782d83eff444bb8cc2a2f776b
parentUse process groups for services (diff)
downloadcatsit-e381f7bbe31a7e0d7fc6155341ce0ce9828c54d3.tar.gz
catsit-e381f7bbe31a7e0d7fc6155341ce0ce9828c54d3.zip
Clear groups list for services
-rw-r--r--service.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/service.c b/service.c
index ec7ac68..e27437f 100644
--- a/service.c
+++ b/service.c
@@ -184,6 +184,9 @@ void serviceStart(struct Service *service) {
 	error = setgid(serviceGID);
 	if (error) err(ExitNoExec, "setgid");
 
+	error = setgroups(1, &serviceGID);
+	if (error) err(ExitNoExec, "setgroups");
+
 	error = setuid(serviceUID);
 	if (error) err(ExitNoExec, "setuid");