1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/testsuite/smbd
Alex Richardson 2c18a98253 Don't use sysconf(_SC_NGROUPS_MAX) on macOS for getgroups()
On MacOS sysconf(_SC_NGROUPS_MAX) always returns 16. However, this is not
the value used by getgroups(2). MacOS uses nested groups but getgroups(2)
will return the flattened list which can easily exceed 16 groups. In my
testing getgroups() already returns 16 groups on a freshly installed
system. And on a 10.14 system the root user is in more than 16 groups by
default which makes it impossible to run smbd without this change.
Setting _DARWIN_UNLIMITED_GETGROUPS allows getgroups() to return more than
16 groups. This also changes set_unix_security_ctx() to only set up to
16 groups since that is the limit for initgroups() according to the manpage.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=8773

Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep  9 17:43:19 UTC 2021 on sn-devel-184
2021-09-09 17:43:19 +00:00
..
Makefile.se_access_check
Makefile.sec_ctx
se_access_check_allowall.c
se_access_check_allowsome.c
se_access_check_denyall.c
se_access_check_denysome.c
se_access_check_empty.c
se_access_check_nullsd.c
se_access_check_printer.c
se_access_check_utils.c
se_access_check_utils.h
se_access_check.exp
sec_ctx1.c
sec_ctx_current_user.c
sec_ctx_flow.c
sec_ctx_groups.c
sec_ctx_nonroot.c
sec_ctx_root.c
sec_ctx_stack.c
sec_ctx_torture.c
sec_ctx_utils.c
sec_ctx_utils.h
sec_ctx.exp
sighup.exp