summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_usrreq.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2010-07-26 01:56:27 +0000
committerguenther <guenther@openbsd.org>2010-07-26 01:56:27 +0000
commit207e4b38a785bf665de26471f4fc5fde67fa99f0 (patch)
tree5b61a93df6c22438e6a0955afca220cb2f2207a0 /sys/ddb/db_usrreq.c
parentAdd missing braces so a loop will function as intended. (diff)
downloadwireguard-openbsd-207e4b38a785bf665de26471f4fc5fde67fa99f0.tar.xz
wireguard-openbsd-207e4b38a785bf665de26471f4fc5fde67fa99f0.zip
Correct the links between threads, processes, pgrps, and sessions,
so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
Diffstat (limited to 'sys/ddb/db_usrreq.c')
-rw-r--r--sys/ddb/db_usrreq.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/ddb/db_usrreq.c b/sys/ddb/db_usrreq.c
index f62908fcc65..b93d6674971 100644
--- a/sys/ddb/db_usrreq.c
+++ b/sys/ddb/db_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_usrreq.c,v 1.13 2008/11/08 01:14:51 mpf Exp $ */
+/* $OpenBSD: db_usrreq.c,v 1.14 2010/07/26 01:56:27 guenther Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff. All rights reserved.
@@ -91,10 +91,11 @@ ddb_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
return (sysctl_int(oldp, oldlenp, newp, newlen, &db_log));
case DBCTL_TRIGGER:
if (newp && db_console) {
- struct proc *p = curproc;
+ struct process *pr = curproc->p_p;
+
if (securelevel < 1 ||
- (p->p_flag & P_CONTROLT && cn_tab &&
- cn_tab->cn_dev == p->p_session->s_ttyp->t_dev)) {
+ (pr->ps_flags & PS_CONTROLT && cn_tab &&
+ cn_tab->cn_dev == pr->ps_session->s_ttyp->t_dev)) {
Debugger();
newp = NULL;
} else