summaryrefslogtreecommitdiff
path: root/src/crypt
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2024-04-13 12:15:37 -0400
committerRich Felker <dalias@aerifal.cx>2024-04-13 23:05:46 -0400
commit3f49203c55ccd5d4217abf13addb18844136455f (patch)
treeb7f8de0116bc01b320562659970fb1c2b29118f1 /src/crypt
parent24ebbbdedcf626808a902d8797df239f94af9620 (diff)
downloadmusl-3f49203c55ccd5d4217abf13addb18844136455f.tar.gz
initgroups: do not artificially limit number of supplementary groups
historically linux limited the number of supplementary groups a process could be in to 32, but this limit was raised to 65536 in linux 2.6.4. proposals to support the new limit, change NGROUPS_MAX, or make it dynamic have been stalled due to the impact it would have on initgroups where the groups array exists in automatic storage. the changes here decouple initgroups from the value of NGROUPS_MAX and allow it to fall back to allocating a buffer in the case where getgrouplist indicates the user has more supplementary groups than could be reported in the buffer. getgrouplist already involves allocation, so this does not pull in any new link dependency. likewise, getgrouplist is already using the public malloc (vs internal libc one), so initgroups does the same. if this turns out not to be the best choice, both can be changed together later. the initial buffer size is left at 32, but now as the literal value, so that any potential future change to NGROUPS_MAX will not affect initgroups.
Diffstat (limited to 'src/crypt')
0 files changed, 0 insertions, 0 deletions