diff options
author | brooks <brooks@FreeBSD.org> | 2009-07-24 15:03:10 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2009-07-24 15:03:10 +0000 |
commit | 7931ef2c42a175d0957f704dfff6807c82adecff (patch) | |
tree | a288a45405a0766b2d46ab342c920d88b33aeff5 /lib/libkvm/kvm_proc.c | |
parent | 44220d7e1e07bbf1c88215543c5877abcdb88d29 (diff) | |
download | FreeBSD-src-7931ef2c42a175d0957f704dfff6807c82adecff.zip FreeBSD-src-7931ef2c42a175d0957f704dfff6807c82adecff.tar.gz |
Revert the changes to struct kinfo_proc in r194498. Instead, fill
in up to 16 (KI_NGROUPS) values and steal a bit from ki_cr_flags
(all bits currently unused) to indicate overflow with the new flag
KI_CRF_GRP_OVERFLOW.
This fixes procstat -s.
Approved by: re (kib)
Diffstat (limited to 'lib/libkvm/kvm_proc.c')
-rw-r--r-- | lib/libkvm/kvm_proc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index d765b6e..7fb85a4 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -145,8 +145,14 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) kp->ki_svuid = ucred.cr_svuid; kp->ki_rgid = ucred.cr_rgid; kp->ki_svgid = ucred.cr_svgid; - kp->ki_ngroups = ucred.cr_ngroups; - kp->ki_groups = ucred.cr_groups; + kp->ki_cr_flags = ucred.cr_flags; + if (ucred.cr_ngroups > KI_NGROUPS) { + kp->ki_ngroups = KI_NGROUPS; + kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW; + } + kp->ki_ngroups = ucred.cr_ngroups; + bcopy(ucred.cr_groups, kp->ki_groups, + kp->ki_ngroups * sizeof(gid_t)); kp->ki_uid = ucred.cr_uid; if (ucred.cr_prison != NULL) { if (KREAD(kd, (u_long)ucred.cr_prison, &pr)) { |