opnsense-src/usr.bin/procstat
Olivier Certner 09290c3a0c
cred: Hide internal flag CRED_FLAG_CAPMODE
This flag is used in field 'cr_flags', which is never directly visible
outside the kernel.  That field is however exported through 'struct
kinfo_proc' objects (field 'ki_cr_flags'), either from the kernel via
sysctls or from libkvm, and is supposed to contain exported flags
prefixed with KI_CRF_ (currently, KI_CRF_CAPABILITY_MODE and
KI_CRF_GRP_OVERFLOW, this second one being a purely userland one
signaling overflow of 'ki_groups').

Make sure that KI_CRF_CAPABILITY_MODE is the flag actually exported and
tested by userland programs, and hide the internal CRED_FLAG_CAPMODE.
As both flags are currently defined to the same value, this doesn't
change the KBI, but of course does change the KPI.  A code search via
GitHub and Google fortunately doesn't reveal any outside uses for
CRED_FLAG_CAPMODE.

While here, move assignment of 'ki_uid' to a more logical place in
kvm_proclist(), and definition of XU_NGROUPS as well in 'sys/ucred.h'
(no functional/interface changes intended).

Reviewed by:    mhorne
Approved by:    markj (mentor)
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46909
2024-12-16 15:42:29 +01:00
..
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile procstat(1): add rlimitusage subcommand 2024-09-27 18:02:34 +03:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
procstat.1 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
procstat.c procstat(1): add rlimitusage subcommand 2024-09-27 18:02:34 +03:00
procstat.h procstat(1): add rlimitusage subcommand 2024-09-27 18:02:34 +03:00
procstat_advlock.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
procstat_args.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_auxv.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_basic.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_bin.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_cred.c cred: Hide internal flag CRED_FLAG_CAPMODE 2024-12-16 15:42:29 +01:00
procstat_cs.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_files.c Add fchroot(2) 2024-11-29 12:10:02 +00:00
procstat_kstack.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_penv.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_ptlwpinfo.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_pwdx.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_rlimit.c procstat: support RLIMIT_PIPEBUF 2024-09-20 09:46:07 +03:00
procstat_rlimitusage.c procstat(1): add rlimitusage subcommand 2024-09-27 18:02:34 +03:00
procstat_rusage.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_sigs.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_threads.c usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
procstat_vm.c procstat vm: report posix shm segment mapping 2024-10-08 15:38:23 +03:00