mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
kinfo_proc: Restore outputting the effective GID
In particular, fixes 'procstat -s' on a live system or a core file (only
if there are less than 16 groups).
Reviewed by: kib
Fixes: be1f7435ef ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after: 9 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52259
This commit is contained in:
parent
5568b4441d
commit
63a40ca813
1 changed files with 5 additions and 4 deletions
|
|
@ -1112,13 +1112,14 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp)
|
|||
if (cred->cr_flags & CRED_FLAG_CAPMODE)
|
||||
kp->ki_cr_flags |= KI_CRF_CAPABILITY_MODE;
|
||||
/* XXX bde doesn't like KI_NGROUPS */
|
||||
if (cred->cr_ngroups > KI_NGROUPS) {
|
||||
if (1 + cred->cr_ngroups > KI_NGROUPS) {
|
||||
kp->ki_ngroups = KI_NGROUPS;
|
||||
kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW;
|
||||
} else
|
||||
kp->ki_ngroups = cred->cr_ngroups;
|
||||
bcopy(cred->cr_groups, kp->ki_groups,
|
||||
kp->ki_ngroups * sizeof(gid_t));
|
||||
kp->ki_ngroups = 1 + cred->cr_ngroups;
|
||||
kp->ki_groups[0] = cred->cr_gid;
|
||||
bcopy(cred->cr_groups, kp->ki_groups + 1,
|
||||
(kp->ki_ngroups - 1) * sizeof(gid_t));
|
||||
kp->ki_rgid = cred->cr_rgid;
|
||||
kp->ki_svgid = cred->cr_svgid;
|
||||
/* If jailed(cred), emulate the old P_JAILED flag. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue