mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
kvm_proclist(): Restore outputting the effective GID
In particular, fixes 'procstat -s -M' (only if there are less than 16
groups).
Reviewed by: kib, emaste
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/D52260
This commit is contained in:
parent
63a40ca813
commit
7676df2fae
1 changed files with 5 additions and 4 deletions
|
|
@ -150,13 +150,14 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc *p,
|
|||
kp->ki_cr_flags = 0;
|
||||
if (ucred.cr_flags & CRED_FLAG_CAPMODE)
|
||||
kp->ki_cr_flags |= KI_CRF_CAPABILITY_MODE;
|
||||
if (ucred.cr_ngroups > KI_NGROUPS) {
|
||||
if (1 + ucred.cr_ngroups > KI_NGROUPS) {
|
||||
kp->ki_ngroups = KI_NGROUPS;
|
||||
kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW;
|
||||
} else
|
||||
kp->ki_ngroups = ucred.cr_ngroups;
|
||||
kvm_read(kd, (u_long)ucred.cr_groups, kp->ki_groups,
|
||||
kp->ki_ngroups * sizeof(gid_t));
|
||||
kp->ki_ngroups = 1 + ucred.cr_ngroups;
|
||||
kp->ki_groups[0] = ucred.cr_gid;
|
||||
kvm_read(kd, (u_long)ucred.cr_groups, kp->ki_groups + 1,
|
||||
(kp->ki_ngroups - 1) * sizeof(gid_t));
|
||||
if (ucred.cr_prison != NULL) {
|
||||
if (KREAD(kd, (u_long)ucred.cr_prison, &pr)) {
|
||||
_kvm_err(kd, kd->program,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue