NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
Find a file
Tiago Natel 2f23923e44 Changed the group listing to run unprivileged when possible.
Now the nxt_user_groups_get() function uses getgrouplist(3) when available
(except MacOS, see below).  For some platforms, getgrouplist() supports
a method of probing how much groups the user has but the behavior is not
consistent.  The method used here consists of optimistically trying to get up
to min(256, NGROUPS_MAX) groups; only if ngroups returned exceeds the original
value, we do a second call.  This method can block main's process if LDAP/NDIS+
is in use.

MacOS has getgrouplist(3) but it's buggy.  It doesn't update ngroups if the
value passed is smaller than the number of groups the user has.  Some
projects (like Go stdlib) call getgrouplist() in a loop, increasing ngroups
until it exceeds the number of groups user belongs to or fail when a limit
is reached.  For performance reasons, this is to be avoided and MacOS is
handled in the fallback implementation.

The fallback implementation is the old Unit approach.  It saves main's
user groups (getgroups(2)) and then calls initgroups(3) to load application's
groups in main, then does a second getgroups(2) to store the gids and restore
main's groups in the end.  Because of initgroups(3)' call to setgroups(2),
this method requires root capabilities.  In the case of OSX, which has
small NGROUPS_MAX by default (16), it's not possible to restore main's groups
if it's large; if so, this method fallbacks again: user_cred gids aren't
stored, and the worker process calls initgroups() itself and may block for
some time if LDAP/NDIS+ is in use.
2019-11-26 16:15:23 +00:00
auto Changed the group listing to run unprivileged when possible. 2019-11-26 16:15:23 +00:00
docs Packages: added Ubuntu 19.10 "eoan" support. 2019-11-21 14:13:24 +03:00
pkg Packages: added Ubuntu 19.10 "eoan" support. 2019-11-21 14:13:24 +03:00
src Changed the group listing to run unprivileged when possible. 2019-11-26 16:15:23 +00:00
test Tests: added getjson() helper. 2019-11-26 16:00:11 +00:00
.hgtags Added tag 1.13.0 for changeset 3313bf222e6e 2019-11-14 19:25:20 +03:00
CHANGES Added version 1.13.0 CHANGES. 2019-11-14 19:23:38 +03:00
configure Initial applications isolation support using Linux namespaces. 2019-09-19 15:25:23 +03:00
LICENSE Added LICENSE and NOTICE files. 2017-09-06 18:26:37 +03:00
NOTICE Year 2019. 2019-01-09 18:03:48 +03:00
README README: added project name to the beginning. 2017-09-19 19:05:03 +03:00
version Version bump. 2019-11-22 16:39:15 +03:00

NGINX Unit
----------

The documentation and binary packages are available online:

  http://unit.nginx.org

The source code is provided under the terms of Apache License 2.0:

  http://hg.nginx.org/unit

Please ask questions, report issues, and send patches to the mailing list:

  unit@nginx.org (http://mailman.nginx.org/mailman/listinfo/unit)

or via Github:

  https://github.com/nginx/unit

--
NGINX, Inc.
http://nginx.com