summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authormarius <marius@openbsd.org>2004-07-07 07:31:40 +0000
committermarius <marius@openbsd.org>2004-07-07 07:31:40 +0000
commitf5194861ac19d8129b33b767dd4d9549c5d94cc8 (patch)
tree8a307bfc754b5f93ffa310c9b9150534e64dccfa /sys/kern/kern_exec.c
parentEndian conversion mistakenly done before fraction math; ok henning@ (diff)
downloadwireguard-openbsd-f5194861ac19d8129b33b767dd4d9549c5d94cc8.tar.xz
wireguard-openbsd-f5194861ac19d8129b33b767dd4d9549c5d94cc8.zip
fix an issue when scripts are exec'd under systrace where
the argv[0] would be normalized, and hence break scripts that depend on how they were called. this fixes an issue in the ports builds. ok provos@ deraadt@; lots of testing during hackathon sturm@ naddy@
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index c7fb1aad5d3..cfb0ecc0bef 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.87 2004/06/23 05:16:35 marius Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.88 2004/07/07 07:31:40 marius Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -275,6 +275,9 @@ sys_execve(p, v, retval)
p->p_flag |= P_INEXEC;
#if NSYSTRACE > 0
+ if (ISSET(p->p_flag, P_SYSTRACE))
+ systrace_execve0(p);
+
error = copyinstr(SCARG(uap, path), pathbuf, MAXPATHLEN, &pathbuflen);
if (error != 0)
goto clrflag;
@@ -653,7 +656,7 @@ sys_execve(p, v, retval)
if (ISSET(p->p_flag, P_SYSTRACE) &&
wassugid && !ISSET(p->p_flag, P_SUGID) &&
!ISSET(p->p_flag, P_SUGIDEXEC))
- systrace_execve(pathbuf, p);
+ systrace_execve1(pathbuf, p);
#endif
return (0);