Page MenuHomeFreeBSD

cred: kern_setgroups(): Internally use int as number of groups' type
Needs ReviewPublic

Authored by olce on Fri, Oct 4, 8:07 AM.

Details

Reviewers
mhorne
mjg
emaste
Summary

sys_setgroups() (and sys_getgroups()) was changed in commit "kern: fail
getgroup and setgroup with negative int" (4bc2174a1b48) to take the
number of groups as an 'int' (for sys_getgroups(), this is a mandatory
requirement to be POSIX-compliant; for sys_setgroups(), it's arguably
for consistency).

All our internal APIs related to groups on 'struct ucred', as well as
related members on the latter, treat that number as an 'int' as well
(and not a 'u_int').

Consequently, to avoid surprises, change kern_setgroups() to behave the
same, and fix audit_arg_groupset() accordingly. With that change,
everything is handled with signed integers internally.

Update sanity checks accordingly.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59723
Build 56609: arc lint + arc unit