diff options
Diffstat (limited to 'sys/kern/kern_proc.c')
| -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 03966e2861ef..3703cee7fb0b 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;  | 
