service: drop a service's group when the configuration drops it

Changing a service from @alice:wheel to @alice, or removing group from
a block, and reloading kept the service running as group wheel, also
after a restart.

The group is only set when the configuration has one, and on reload
the service is updated in place, so the old one stayed.

Clear it before parsing, like a new service gets it.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-17 06:21:25 +01:00
1 parent de73b06415
commit bf42811a13
3 files changed
+30 -5

No files matched your search

+1
View File
@@ -2492,6 +2492,7 @@ svc_t *service_register_desc(int type, char *cfg, const char *desc,
svc_unblock(svc);
}
svc->group[0] = 0;
svc->supgroups[0] = 0;
if (username) {
char *ptr = strchr(username, ':');