mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-03 05:02:18 +00:00
abuild-sudo: fix determining number of groups
Musl _SC_NGROUPS_MAX is fixed at 32. The kernel can support more. Query the kernel for number of groups needed.
This commit is contained in:
parent
69d15d3225
commit
8d6fb8b45f
@ -62,7 +62,7 @@ void check_option(const char *opt)
|
||||
|
||||
int is_in_group(gid_t group)
|
||||
{
|
||||
int ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;
|
||||
int ngroups_max = getgroups(0, 0);
|
||||
gid_t *buf = malloc(ngroups_max * sizeof(gid_t));
|
||||
int ngroups;
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user