Index: kern_proc.c =================================================================== RCS file: /usr/repo/src/sys/kern/kern_proc.c,v retrieving revision 1.215.2.5 diff -u -p -r1.215.2.5 kern_proc.c --- kern_proc.c 1 Mar 2005 09:30:18 -0000 1.215.2.5 +++ kern_proc.c 19 Mar 2005 00:33:51 -0000 @@ -623,6 +623,7 @@ fill_kinfo_thread(struct thread *td, str struct tty *tp; struct session *sp; struct timeval tv; + struct ucred *cred; struct sigacts *ps; p = td->td_proc; @@ -643,19 +644,24 @@ fill_kinfo_thread(struct thread *td, str #endif kp->ki_fd = p->p_fd; kp->ki_vmspace = p->p_vmspace; - if (p->p_ucred) { - kp->ki_uid = p->p_ucred->cr_uid; - kp->ki_ruid = p->p_ucred->cr_ruid; - kp->ki_svuid = p->p_ucred->cr_svuid; + kp->ki_flag = p->p_flag; + cred = p->p_ucred; + if (cred) { + kp->ki_uid = cred->cr_uid; + kp->ki_ruid = cred->cr_ruid; + kp->ki_svuid = cred->cr_svuid; /* XXX bde doesn't like KI_NGROUPS */ - kp->ki_ngroups = min(p->p_ucred->cr_ngroups, KI_NGROUPS); - bcopy(p->p_ucred->cr_groups, kp->ki_groups, + kp->ki_ngroups = min(cred->cr_ngroups, KI_NGROUPS); + bcopy(cred->cr_groups, kp->ki_groups, kp->ki_ngroups * sizeof(gid_t)); - kp->ki_rgid = p->p_ucred->cr_rgid; - kp->ki_svgid = p->p_ucred->cr_svgid; + kp->ki_rgid = cred->cr_rgid; + kp->ki_svgid = cred->cr_svgid; + /* If jailed(cred), emulate the old P_JAILED flag. */ + if (jailed(cred)) + kp->ki_flag |= P_JAILED; } - if (p->p_sigacts) { - ps = p->p_sigacts; + ps = p->p_sigacts; + if (ps) { mtx_lock(&ps->ps_mtx); kp->ki_sigignore = ps->ps_sigignore; kp->ki_sigcatch = ps->ps_sigcatch; @@ -764,7 +770,6 @@ fill_kinfo_thread(struct thread *td, str kp->ki_stat = SZOMB; } mtx_unlock_spin(&sched_lock); - sp = NULL; tp = NULL; if (p->p_pgrp) { kp->ki_pgid = p->p_pgrp->pg_id; @@ -803,10 +808,6 @@ fill_kinfo_thread(struct thread *td, str kp->ki_sigmask = td->td_sigmask; kp->ki_xstat = p->p_xstat; kp->ki_acflag = p->p_acflag; - kp->ki_flag = p->p_flag; - /* If jailed(p->p_ucred), emulate the old P_JAILED flag. */ - if (jailed(p->p_ucred)) - kp->ki_flag |= P_JAILED; kp->ki_lock = p->p_lock; if (p->p_pptr) kp->ki_ppid = p->p_pptr->p_pid;