summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_proc.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-03-20 10:35:23 +0000
committerpjd <pjd@FreeBSD.org>2005-03-20 10:35:23 +0000
commit2275c8c92e33f471bea52f1fefed5d8dc4c3c7ec (patch)
treedcadee16f40d4fcd17afaaea7d03cf295e616a7c /sys/kern/kern_proc.c
parent26ccbbe0103e9179d4bbf18cf158b0f163759bbe (diff)
downloadFreeBSD-src-2275c8c92e33f471bea52f1fefed5d8dc4c3c7ec.zip
FreeBSD-src-2275c8c92e33f471bea52f1fefed5d8dc4c3c7ec.tar.gz
Add ki_jid field to the kinfo_proc structure and store jail ID there.
Reviewed by: gad MFC after: 3 days
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r--sys/kern/kern_proc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 0924325..0b3ecfd 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -653,8 +653,12 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp)
kp->ki_rgid = cred->cr_rgid;
kp->ki_svgid = cred->cr_svgid;
/* If jailed(cred), emulate the old P_JAILED flag. */
- if (jailed(cred))
+ if (jailed(cred)) {
kp->ki_flag |= P_JAILED;
+ /* If inside a jail, use 0 as a jail ID. */
+ if (!jailed(curthread->td_ucred))
+ kp->ki_jid = cred->cr_prison->pr_id;
+ }
}
ps = p->p_sigacts;
if (ps) {
OpenPOWER on IntegriCloud