summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2001-07-05 17:10:46 +0000
committerrwatson <rwatson@FreeBSD.org>2001-07-05 17:10:46 +0000
commitda1a848c61b09f2607111b298ac57fe2dcb183da (patch)
tree12e1eac2ac7b907cb9e647b6cd5c337073cd615c /sys/fs/procfs
parentfcb893ccd5ba7f15c5e4198222a83cecc659c067 (diff)
downloadFreeBSD-src-da1a848c61b09f2607111b298ac57fe2dcb183da.zip
FreeBSD-src-da1a848c61b09f2607111b298ac57fe2dcb183da.tar.gz
o Replace calls to p_can(..., P_CAN_xxx) with calls to p_canxxx().
The p_can(...) construct was a premature (and, it turns out, awkward) abstraction. The individual calls to p_canxxx() better reflect differences between the inter-process authorization checks, such as differing checks based on the type of signal. This has a side effect of improving code readability. o Replace direct credential authorization checks in ktrace() with invocation of p_candebug(), while maintaining the special case check of KTR_ROOT. This allows ktrace() to "play more nicely" with new mandatory access control schemes, as well as making its authorization checks consistent with other "debugging class" checks. o Eliminate "privused" construct for p_can*() calls which allowed the caller to determine if privilege was required for successful evaluation of the access control check. This primitive is currently unused, and as such, serves only to complicate the API. Approved by: ({procfs,linprocfs} changes) des Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/fs/procfs')
-rw-r--r--sys/fs/procfs/procfs_ctl.c2
-rw-r--r--sys/fs/procfs/procfs_dbregs.c2
-rw-r--r--sys/fs/procfs/procfs_fpregs.c2
-rw-r--r--sys/fs/procfs/procfs_mem.c2
-rw-r--r--sys/fs/procfs/procfs_regs.c2
-rw-r--r--sys/fs/procfs/procfs_status.c2
-rw-r--r--sys/fs/procfs/procfs_vnops.c18
7 files changed, 15 insertions, 15 deletions
diff --git a/sys/fs/procfs/procfs_ctl.c b/sys/fs/procfs/procfs_ctl.c
index a507349..30b61f2 100644
--- a/sys/fs/procfs/procfs_ctl.c
+++ b/sys/fs/procfs/procfs_ctl.c
@@ -119,7 +119,7 @@ procfs_control(curp, p, op)
* debug.
*/
if (op != PROCFS_CTL_DETACH &&
- ((error = p_can(curp, p, P_CAN_DEBUG, NULL))))
+ ((error = p_candebug(curp, p))))
return (error);
/*
diff --git a/sys/fs/procfs/procfs_dbregs.c b/sys/fs/procfs/procfs_dbregs.c
index cd64a34..d61b8c9 100644
--- a/sys/fs/procfs/procfs_dbregs.c
+++ b/sys/fs/procfs/procfs_dbregs.c
@@ -68,7 +68,7 @@ procfs_dodbregs(curp, p, pfs, uio)
char *kv;
int kl;
- if (p_can(curp, p, P_CAN_DEBUG, NULL))
+ if (p_candebug(curp, p))
return (EPERM);
kl = sizeof(r);
kv = (char *) &r;
diff --git a/sys/fs/procfs/procfs_fpregs.c b/sys/fs/procfs/procfs_fpregs.c
index c71e444..9b6cd3a 100644
--- a/sys/fs/procfs/procfs_fpregs.c
+++ b/sys/fs/procfs/procfs_fpregs.c
@@ -65,7 +65,7 @@ procfs_dofpregs(curp, p, pfs, uio)
char *kv;
int kl;
- if (p_can(curp, p, P_CAN_DEBUG, NULL))
+ if (p_candebug(curp, p))
return EPERM;
kl = sizeof(r);
kv = (char *) &r;
diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c
index e109146..dcba9b0 100644
--- a/sys/fs/procfs/procfs_mem.c
+++ b/sys/fs/procfs/procfs_mem.c
@@ -263,7 +263,7 @@ procfs_domem(curp, p, pfs, uio)
* All in all, quite yucky.
*/
- if (p_can(curp, p, P_CAN_DEBUG, NULL) &&
+ if (p_candebug(curp, p) &&
!(uio->uio_rw == UIO_READ &&
procfs_kmemaccess(curp)))
return EPERM;
diff --git a/sys/fs/procfs/procfs_regs.c b/sys/fs/procfs/procfs_regs.c
index c7eeb1c..6a00ecd 100644
--- a/sys/fs/procfs/procfs_regs.c
+++ b/sys/fs/procfs/procfs_regs.c
@@ -66,7 +66,7 @@ procfs_doregs(curp, p, pfs, uio)
char *kv;
int kl;
- if (p_can(curp, p, P_CAN_DEBUG, NULL))
+ if (p_candebug(curp, p))
return EPERM;
kl = sizeof(r);
kv = (char *) &r;
diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c
index 0f57e49..3a2a814 100644
--- a/sys/fs/procfs/procfs_status.c
+++ b/sys/fs/procfs/procfs_status.c
@@ -219,7 +219,7 @@ procfs_docmdline(curp, p, pfs, uio)
* Linux behaviour is to return zero-length in this case.
*/
- if (p->p_args && (ps_argsopen || !p_can(curp, p, P_CAN_SEE, NULL))) {
+ if (p->p_args && (ps_argsopen || !p_cansee(curp, p))) {
bp = p->p_args->ar_args;
buflen = p->p_args->ar_length;
buf = 0;
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c
index 4ca89ac..bc280c78 100644
--- a/sys/fs/procfs/procfs_vnops.c
+++ b/sys/fs/procfs/procfs_vnops.c
@@ -143,7 +143,7 @@ procfs_open(ap)
p2 = PFIND(pfs->pfs_pid);
if (p2 == NULL)
return (ENOENT);
- if (pfs->pfs_pid && p_can(ap->a_p, p2, P_CAN_SEE, NULL)) {
+ if (pfs->pfs_pid && p_cansee(ap->a_p, p2)) {
error = ENOENT;
goto out;
}
@@ -157,7 +157,7 @@ procfs_open(ap)
}
p1 = ap->a_p;
- if (p_can(p1, p2, P_CAN_DEBUG, NULL) &&
+ if (p_candebug(p1, p2) &&
!procfs_kmemaccess(p1)) {
error = EPERM;
}
@@ -242,7 +242,7 @@ procfs_ioctl(ap)
return ENOTTY;
}
- if ((error = p_can(p, procp, P_CAN_DEBUG, NULL))) {
+ if ((error = p_candebug(p, procp))) {
PROC_UNLOCK(procp);
return (error == ESRCH ? ENOENT : error);
}
@@ -408,7 +408,7 @@ procfs_getattr(ap)
return (ENOENT);
}
- if (p_can(ap->a_p, procp, P_CAN_SEE, NULL)) {
+ if (p_cansee(ap->a_p, procp)) {
PROC_UNLOCK(procp);
return (ENOENT);
}
@@ -625,7 +625,7 @@ procfs_access(ap)
procp = PFIND(pfs->pfs_pid);
if (procp == NULL)
return (ENOENT);
- if (p_can(ap->a_p, procp, P_CAN_SEE, NULL)) {
+ if (p_cansee(ap->a_p, procp)) {
PROC_UNLOCK(procp);
return (ENOENT);
}
@@ -699,7 +699,7 @@ procfs_lookup(ap)
if (p == NULL)
break;
- if (p_can(curp, p, P_CAN_SEE, NULL)) {
+ if (p_cansee(curp, p)) {
PROC_UNLOCK(p);
break;
}
@@ -800,7 +800,7 @@ procfs_readdir(ap)
p = PFIND(pfs->pfs_pid);
if (p == NULL)
break;
- if (p_can(curproc, p, P_CAN_SEE, NULL)) {
+ if (p_cansee(curproc, p)) {
PROC_UNLOCK(p);
break;
}
@@ -868,11 +868,11 @@ procfs_readdir(ap)
p = LIST_NEXT(p, p_list);
if (p == NULL)
goto done;
- if (p_can(curproc, p, P_CAN_SEE, NULL))
+ if (p_cansee(curproc, p))
continue;
pcnt++;
}
- while (p_can(curproc, p, P_CAN_SEE, NULL)) {
+ while (p_cansee(curproc, p)) {
p = LIST_NEXT(p, p_list);
if (p == NULL)
goto done;
OpenPOWER on IntegriCloud