Doing away with NGROUPS_MAX in src/sys/sys/syslimits.h?
ttw+bsd at cobbled.net
ttw+bsd at cobbled.net
Mon Mar 23 05:57:53 PDT 2009
On 23.03-00:39, David Schultz wrote:
[ ... ]
> There's already a kern.ngroups sysctl, but there are many places
> where `ngroups' needs to be used in preference to NGROUPS in the
> kernel. In userland, sysconf(_SC_NGROUPS_MAX) needs to be used in
> preference to NGROUPS_MAX.
you will also note that, as you look at this more, NGROUPS_MAX controls
very little regarding the relevant buffers and, generally, without
reviewing it again to be specific i'd suggest that you may expose a
number of buffer overruns but will most certainally not get the
'correct' behaviour from the change. i.e. removing NGROUPS_MAX may
remove an error message from setgroups but will not increase the buffer
allocations or alter relevant code to check NGROUPS_MAX correctly.
More information about the freebsd-hackers
mailing list