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 /sys/kern | |
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 'sys/kern')
-rw-r--r-- | sys/kern/kern_proc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 03966e2..3703cee 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -730,11 +730,17 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) kp->ki_uid = cred->cr_uid; kp->ki_ruid = cred->cr_ruid; kp->ki_svuid = cred->cr_svuid; - kp->ki_ngroups = cred->cr_ngroups; - kp->ki_groups = cred->cr_groups; + kp->ki_cr_flags = cred->cr_flags; + /* XXX bde doesn't like KI_NGROUPS */ + if (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_rgid = cred->cr_rgid; kp->ki_svgid = cred->cr_svgid; - kp->ki_cr_flags = cred->cr_flags; /* If jailed(cred), emulate the old P_JAILED flag. */ if (jailed(cred)) { kp->ki_flag |= P_JAILED; |