service: lift the limit of four supplementary groups

A service listing more than four supplementary groups, as in
@user:group,sup1,sup2,..., got only the first four:

    too many supplementary groups, max 4

The names were stored in a fixed array of four.  It was also only
reset when the new configuration listed groups, so groups dropped from
a service lingered until reboot.

Store the list as one string, split when the service starts, and set
it on every (re)registration.  A list longer than 511 characters drops
the name it cuts off, which may otherwise match another group.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
(cherry picked from commit de73b06415)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-17 08:02:42 +01:00
1 parent 66b62cbd45
commit 5049c32c35
5 files changed
+71 -22

No files matched your search

+5
View File
@@ -34,6 +34,11 @@ All relevant changes are documented in this file.
or `pidof`. It was taken as the `log` or `pid` option and the next
argument ran as the command, which also broke the `logger` example in
finit.conf(5)
- A service can have more than four supplementary groups, as in
`@user:group,sup1,sup2,...`. The list may now be up to 511
characters. Groups dropped from a service's configuration are now
also dropped the next time it starts, before they lingered until
reboot
- Remove stale daemon-owned (`pid:!`) pidfiles after unclean exits.
When a daemon dies via SIGKILL/OOM/segfault, or exits early during
startup, its pidfile lingers and can prevent the next instance from