summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2001-11-08 02:13:18 +0000
committerrwatson <rwatson@FreeBSD.org>2001-11-08 02:13:18 +0000
commit8cf42b482a9aa3f9ec41071c44bc18a0ea425abf (patch)
treef48964de5180c6b27c3272456da3b93d16bd1ea3 /sys/kern
parentc4a9f1d3ab184e9dddf4227f8e0781b59d1a82b7 (diff)
downloadFreeBSD-src-8cf42b482a9aa3f9ec41071c44bc18a0ea425abf.zip
FreeBSD-src-8cf42b482a9aa3f9ec41071c44bc18a0ea425abf.tar.gz
o Replace reference to 'struct proc' with 'struct thread' in 'struct
sysctl_req', which describes in-progress sysctl requests. This permits sysctl handlers to have access to the current thread, permitting work on implementing td->td_ucred, migration of suser() to using struct thread to derive the appropriate ucred, and allowing struct thread to be passed down to other code, such as network code where td is not currently available (and curproc is used). o Note: netncp and netsmb are not updated to reflect this change, as they are not currently KSE-adapted. Reviewed by: julian Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_mib.c8
-rw-r--r--sys/kern/kern_sysctl.c12
-rw-r--r--sys/kern/uipc_usrreq.c2
3 files changed, 11 insertions, 11 deletions
diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c
index ced42e5..1775abf 100644
--- a/sys/kern/kern_mib.c
+++ b/sys/kern/kern_mib.c
@@ -155,12 +155,12 @@ sysctl_hostname(SYSCTL_HANDLER_ARGS)
{
int error;
- if (jailed(req->p->p_ucred)) {
+ if (jailed(req->td->td_proc->p_ucred)) {
if (!jail_set_hostname_allowed && req->newptr)
return(EPERM);
error = sysctl_handle_string(oidp,
- req->p->p_ucred->cr_prison->pr_host,
- sizeof req->p->p_ucred->cr_prison->pr_host, req);
+ req->td->td_proc->p_ucred->cr_prison->pr_host,
+ sizeof req->td->td_proc->p_ucred->cr_prison->pr_host, req);
} else
error = sysctl_handle_string(oidp,
hostname, sizeof hostname, req);
@@ -186,7 +186,7 @@ sysctl_kern_securelvl(SYSCTL_HANDLER_ARGS)
struct prison *pr;
int error, level;
- pr = req->p->p_ucred->cr_prison;
+ pr = req->td->td_proc->p_ucred->cr_prison;
/*
* If the process is in jail, return the maximum of the global and
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 03b5a95..e1b41b3 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -848,7 +848,7 @@ kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old,
bzero(&req, sizeof req);
- req.p = td->td_proc;
+ req.td = td;
if (oldlenp) {
req.oldlen = *oldlenp;
@@ -1037,12 +1037,12 @@ sysctl_root(SYSCTL_HANDLER_ARGS)
/* Is this sysctl sensitive to securelevels? */
if (req->newptr && (oid->oid_kind & CTLFLAG_SECURE)) {
- if (req->p == NULL) {
+ if (req->td == NULL) {
error = securelevel_gt(NULL, 0); /* XXX */
if (error)
return (error);
} else {
- error = securelevel_gt(req->p->p_ucred, 0);
+ error = securelevel_gt(req->td->td_proc->p_ucred, 0);
if (error)
return (error);
}
@@ -1050,14 +1050,14 @@ sysctl_root(SYSCTL_HANDLER_ARGS)
/* Is this sysctl writable by only privileged users? */
if (req->newptr && !(oid->oid_kind & CTLFLAG_ANYBODY)) {
- if (req->p != NULL) {
+ if (req->td != NULL) {
int flags;
if (oid->oid_kind & CTLFLAG_PRISON)
flags = PRISON_ROOT;
else
flags = 0;
- error = suser_xxx(NULL, req->p, flags);
+ error = suser_xxx(NULL, req->td->td_proc, flags);
if (error)
return (error);
}
@@ -1132,7 +1132,7 @@ userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
bzero(&req, sizeof req);
- req.p = td->td_proc;
+ req.td = td;
if (oldlenp) {
if (inkernel) {
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index c8dc5fc..b8b7044 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -850,7 +850,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
for (unp = LIST_FIRST(head), i = 0; unp && i < n;
unp = LIST_NEXT(unp, unp_link)) {
if (unp->unp_gencnt <= gencnt) {
- if (cr_cansee(req->p->p_ucred,
+ if (cr_cansee(req->td->td_proc->p_ucred,
unp->unp_socket->so_cred))
continue;
unp_list[i++] = unp;
OpenPOWER on IntegriCloud