freebsd-src/sys/security/audit
Olivier Certner 5d10a05c6d
cred: kern_setgroups(): Internally use int as number of groups' type
sys_setgroups() (and sys_getgroups()) was changed in commit "kern: fail
getgroup and setgroup with negative int" (4bc2174a1b) to take the
number of groups as an 'int' (for sys_getgroups(), POSIX mandates this
change; for sys_setgroups(), which it does not standardize, 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.

Reviewed by:    mhorne
Approved by:    markj (mentor)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D46912

(cherry picked from commit abd39811cd)

Approved by:    markj (mentor)
2024-11-15 11:47:41 +01:00
..
audit_arg.c cred: kern_setgroups(): Internally use int as number of groups' type 2024-11-15 11:47:41 +01:00
audit_bsm_db.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
audit_bsm_klib.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
audit_bsm.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
audit_dtrace.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
audit_ioctl.h
audit_pipe.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
audit_private.h
audit_syscalls.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
audit_trigger.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
audit_worker.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
audit.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
audit.h cred: kern_setgroups(): Internally use int as number of groups' type 2024-11-15 11:47:41 +01:00
bsm_domain.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
bsm_errno.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
bsm_fcntl.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
bsm_socket_type.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
bsm_token.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00