jail: set user and group inside jail
authorDaniel Golle <daniel@makrotopia.org>
Sun, 29 Dec 2019 14:23:34 +0000 (16:23 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 30 Dec 2019 17:52:25 +0000 (19:52 +0200)
commit52c5c1980ba33a71611204957f3061cb51fb65a8
tree31a50e315f3f737d2bb5f6fa49355a48af75ad6d
parent3aa051b44177fc1403acab295f9f833451c4b9f0
jail: set user and group inside jail

This allows jailed services to run as users other than root, simply
because some services refuse to be run as UID 0.
Previously, setting the the process UID and GID before launching the
jail wrapper prevented the jail from starting.
Rather than setting them in procd/service.c, pass user and group
parameters to ujail and set them inside ujail just before executing the
service.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
jail/jail.c
service/instance.c