]> git.kaiwu.me - nginx.git/commit
Core: made initgroups() failures fatal
authorVadim Zhestikov <v.zhestikov@f5.com>
Fri, 9 Oct 2026 21:57:16 +0000 (14:57 -0700)
committerVadimZhestikov <108960056+VadimZhestikov@users.noreply.github.com>
Fri, 23 Oct 2026 14:54:13 +0000 (07:54 -0700)
commit9a7439fd79076de03c408de136ba1772347030c2
treef42aa28ee11b72f80e2c6ec90d7cf254bf1d9467
parent148c75678cd4171338c31d4ed4c02411736d5fe9
Core: made initgroups() failures fatal

Previously, an initgroups() failure was only logged, and the worker
process went on with the supplementary groups inherited from the master
process, since setgid() does not change them.  Anything relying on the
configured user's groups then failed at run time, far from the log
message, and the outcome depended on which worker hit the error.

Now such a failure is fatal, similarly to setgid() and setuid().  The
exception is EPERM, which is logged and ignored: it is returned when
supplementary groups cannot be changed at all, for example, in a user
namespace with setgroups denied, see user_namespaces(7), or under
seccomp.

This dates back to 42b12b34f (0.1.11).
src/os/unix/ngx_process_cycle.c