opnsense-src/bin
Olivier Certner f9fa6cb391
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

(cherry picked from commit 09290c3a0c82524138973b14f393379edf733753)

A ports exp-run (PR 283410) showed one port to be affected
(sysutils/procs), which has been fixed upstream and in the ports tree.
All additional indirect references to CRED_FLAG_CAPMODE we found after
the code search mentioned in the original commit message are
automatically generated from our headers by FFI mechanisms, so
automatically disappear at recompilation (and the KBI is not changed, as
explained above, so recompilation is not needed).
2025-04-08 15:38:14 +02:00
..
cat cat: Check for lack of success rather than a specific failure. 2024-05-14 08:58:40 +02:00
chflags chflags(1): obey siginfo request on chflagsat(2) failure 2024-02-06 02:37:37 +02:00
chio Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
chmod Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
cp cp: Clarify an obscure comment. 2024-04-24 22:11:56 +00:00
cpuset Use proper convention for relative path linking 2023-08-18 04:20:32 -07:00
csh csh: Remove gethost dependency on tc.const.h 2025-02-18 12:19:16 -05:00
date date: Fix a few nits. 2024-10-06 09:12:24 +00:00
dd Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
df Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
domainname Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
echo Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
ed Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
expr Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
freebsd-version bsdinstall: rename "Live CD" to "Live System" 2024-01-07 14:31:10 -05:00
getfacl Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
hostname hostname(1): Add test cases 2024-02-08 14:02:33 +08:00
kenv Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kill kill.1: mention special meaning of PGID as a PID 2025-01-21 02:25:59 +02:00
ln faccessat(2): Honor AT_SYMLINK_NOFOLLOW 2024-09-26 09:13:50 -04:00
ls ls: Release resources before returning from traverse() 2025-01-28 16:00:12 +00:00
mkdir Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
mv mv: Set file flags after setting file times 2024-04-25 09:20:16 -04:00
nproc nproc.1: Fix "first appeared in" details 2023-06-02 18:53:55 +02:00
pax pax: Clear arcn in each read function. 2024-08-01 18:15:57 +02:00
pkill pkill tests: Fix pkill usage in the pkill -x test 2025-04-06 13:54:03 +00:00
ps cred: Hide internal flag CRED_FLAG_CAPMODE 2025-04-08 15:38:14 +02:00
pwait Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
pwd Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
realpath Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
rm Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
rmail Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rmdir Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
setfacl Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
sh sh(1): Replace recommendation of use of -e with a note 2025-03-15 15:00:17 +01:00
sleep Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
stty (s)tty: add support for IUTF8 input flag 2023-10-21 17:28:34 +03:00
sync sync.8: Document that the "sync dance" is not a thing 2024-04-28 20:28:43 +02:00
test Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
timeout timeout(1): Add -v/--verbose option to show diagnosis info 2025-01-19 20:30:13 +01:00
uuidgen pkgbase: Move uuidgen to runtime package 2023-10-18 16:36:30 +02:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00