FreeBSD Bugzilla – Attachment 28700 Details for
Bug 48156
Bug in procfs(5) closed in jail.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.97 KB, created by
Pawel Jakub Dawidek
on 2003-02-10 17:10:07 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Pawel Jakub Dawidek
Created:
2003-02-10 17:10:07 UTC
Size:
1.97 KB
patch
obsolete
>diff -ru procfs.orig/procfs.h procfs/procfs.h >--- procfs.orig/procfs.h Tue Jan 22 18:22:59 2002 >+++ procfs/procfs.h Mon Feb 10 17:13:24 2003 >@@ -100,6 +100,10 @@ > ((p2)->p_flag & (P_SUGID|P_INEXEC)) == 0) || \ > (suser_xxx((p1)->p_cred->pc_ucred, (p1), PRISON_ROOT) == 0)) > >+extern int ps_showallprocs; >+#define PROCS_CHECK(p1, p2) \ >+ (PRISON_CHECK(p1, p2) && (ps_showallprocs || p_trespass(p1, p2) == 0)) >+ > /* > * Convert between pfsnode vnode > */ >diff -ru procfs.orig/procfs_vnops.c procfs/procfs_vnops.c >--- procfs.orig/procfs_vnops.c Tue Jan 22 18:22:59 2002 >+++ procfs/procfs_vnops.c Mon Feb 10 18:02:36 2003 >@@ -138,7 +138,7 @@ > p2 = PFIND(pfs->pfs_pid); > if (p2 == NULL) > return (ENOENT); >- if (pfs->pfs_pid && !PRISON_CHECK(ap->a_p, p2)) >+ if (pfs->pfs_pid && !PROCS_CHECK(ap->a_p, p2)) > return (ENOENT); > > switch (pfs->pfs_type) { >@@ -446,6 +446,8 @@ > if (procp == NULL || procp->p_cred == NULL || > procp->p_ucred == NULL) > return (ENOENT); >+ if (!PROCS_CHECK(ap->a_p, procp)) >+ return (ENOENT); > } > > error = 0; >@@ -734,6 +736,9 @@ > if (p == NULL) > break; > >+ if (!PROCS_CHECK(curproc, p)) >+ break; >+ > return (procfs_allocvp(dvp->v_mount, vpp, pid, Pproc)); > > case Pproc: >@@ -744,6 +749,9 @@ > if (p == NULL) > break; > >+ if (!PROCS_CHECK(curproc, p)) >+ break; >+ > for (pt = proc_targets, i = 0; i < nproc_targets; pt++, i++) { > if (cnp->cn_namelen == pt->pt_namlen && > bcmp(pt->pt_name, pname, cnp->cn_namelen) == 0 && >@@ -827,7 +835,7 @@ > p = PFIND(pfs->pfs_pid); > if (p == NULL) > break; >- if (!PRISON_CHECK(curproc, p)) >+ if (!PROCS_CHECK(curproc, p)) > break; > > for (pt = &proc_targets[i]; >@@ -890,11 +898,11 @@ > p = p->p_list.le_next; > if (!p) > goto done; >- if (!PRISON_CHECK(curproc, p)) >+ if (!PROCS_CHECK(curproc, p)) > continue; > pcnt++; > } >- while (!PRISON_CHECK(curproc, p)) { >+ while (!PROCS_CHECK(curproc, p)) { > p = p->p_list.le_next; > if (!p) > goto done;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48156
: 28700