summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2011-12-14 07:32:16 +0000
committerguenther <guenther@openbsd.org>2011-12-14 07:32:16 +0000
commita2e04e14c7bba4f83f5db2cc788417da45b260c4 (patch)
tree31613602daf80e3d277fa49a50b35109d43d5fda /sys/kern/kern_exec.c
parent*finally* make use of certificate authority file if available ! (diff)
downloadwireguard-openbsd-a2e04e14c7bba4f83f5db2cc788417da45b260c4.tar.xz
wireguard-openbsd-a2e04e14c7bba4f83f5db2cc788417da45b260c4.zip
Handle rthreads consistently in ktrace by moving the flags and vnode into
struct process; KTRFAC_ACTIVE becomes P_INKTR. Also, save the credentials used to open the file in sys_ktrace() and use them for all writes to the vnode. much feedback and ok jsing@
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index ff53d3feb9a..c72d2fcdead 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.121 2011/12/11 19:42:28 guenther Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.122 2011/12/14 07:32:16 guenther Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -516,10 +516,8 @@ sys_execve(struct proc *p, void *v, register_t *retval)
* If process is being ktraced, turn off - unless
* root set it.
*/
- if (p->p_tracep && !(p->p_traceflag & KTRFAC_ROOT)) {
- p->p_traceflag = 0;
- ktrsettracevnode(p, NULL);
- }
+ if (pr->ps_tracevp && !(pr->ps_traceflag & KTRFAC_ROOT))
+ ktrcleartrace(pr);
#endif
p->p_ucred = crcopy(cred);
if (attr.va_mode & VSUID)