diff options
author | pjd <pjd@FreeBSD.org> | 2005-03-12 14:31:04 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-03-12 14:31:04 +0000 |
commit | cbc3f05d7ca6de6d96084d8a9c45f29394f71fcf (patch) | |
tree | b31f25497c1e0174dd7414b688257d6be221ec13 /sys/kern/kern_proc.c | |
parent | f392231d5a05f6944c4c78e97ae96b9ed4a3dda7 (diff) | |
download | FreeBSD-src-cbc3f05d7ca6de6d96084d8a9c45f29394f71fcf.zip FreeBSD-src-cbc3f05d7ca6de6d96084d8a9c45f29394f71fcf.tar.gz |
Function jailed() looks into ucred strcture, so be sure ucred is not NULL.
Reviewed by: rwatson
MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r-- | sys/kern/kern_proc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index d0d4254..2e74cc3 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -633,6 +633,7 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) #endif kp->ki_fd = p->p_fd; kp->ki_vmspace = p->p_vmspace; + kp->ki_flag = p->p_flag; cred = p->p_ucred; if (cred) { kp->ki_uid = cred->cr_uid; @@ -644,6 +645,9 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) kp->ki_ngroups * sizeof(gid_t)); 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; } ps = p->p_sigacts; if (ps) { @@ -792,10 +796,6 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) 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; |