service: initialize supplementary group ids We currently only call setgid() with user's primary group id for service instance processes. In the case of a user belong to multiple groups, it's natural to also explicitly initialize their supplementary group ids Fixes FS#988 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
procd: add timing to start/stop logging Shows how long an initd task took, for example: procd: stop /etc/init.d/dropbear running - took 0.088824s procd: Update service dnsmasq procd: Update instance dnsmasq::dnsmasq procd: running /etc/init.d/dnsmasq running procd: start /etc/init.d/dnsmasq running procd: stop /etc/init.d/dnsmasq running - took 0.092586s v2: rename variables, correct time unit v3: use CLOCK_MONOTONIC_RAW to prevent issues with NTP and adjtime Signed-off-by: Karl Vogel <karl.vogel@gmail.com>
procd: Add %m to several functions that return errno. Might help with debugging. No size impact. Signed-off-by: Rosen Penev <rosenp@gmail.com>
procd: Replace strerror(errno) with %m. Saves 1496 bytes from compiled size under glibc. No functional difference. Signed-off-by: Rosen Penev <rosenp@gmail.com>
procd: initd: fix path allocation in early_insmod Noticed that /tmp was not being created on /dev/zram0. This was on ixp4xx (nslu2) using GCC 6.3 and musl. The allocation should be using the length of the passed string (module path), not the size of the pointer to the string. Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
service: Start services normally when seccomp is disabled When service init file declares seccomp support (procd_set_param seccomp), but procd is compiled without seccomp support, the service should be started normally, because seccomp-trace and utrace are not available. Older procd versions decided about whether to start a service in seccomp sandbox or not based on existence of seccomp whitelist in the filesystem. This was recently removed (c8faedc "Do not disable seccomp when configuration is not found", 2017-09-12) because it could be easy for attackers to disable seccomp support. This changes is a follow-up to the mentioned commit. With it, procd decides about whether to use seccomp sandbox based only on compile-time configuration. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz> Tested-by: Hans Dedecker <dedeckeh@gmail.com>