summaryrefslogtreecommitdiffstats
path: root/sys/kern/exec_script.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/exec_script.c')
-rw-r--r--sys/kern/exec_script.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/kern/exec_script.c b/sys/kern/exec_script.c
index ba6b99f0575..929982fa393 100644
--- a/sys/kern/exec_script.c
+++ b/sys/kern/exec_script.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_script.c,v 1.21 2004/07/07 07:31:40 marius Exp $ */
+/* $OpenBSD: exec_script.c,v 1.22 2005/08/01 07:02:39 art Exp $ */
/* $NetBSD: exec_script.c,v 1.13 1996/02/04 02:15:06 christos Exp $ */
/*
@@ -221,20 +221,21 @@ check_shell:
#endif
/* normally can't fail, but check for it if diagnostic */
#if NSYSTRACE > 0
- error = 1;
if (ISSET(p->p_flag, P_SYSTRACE)) {
error = systrace_scriptname(p, *tmpsap);
if (error == 0)
tmpsap++;
- }
- if (error != 0)
- /*
- * Since systrace_scriptname() provides a
- * convenience, not a security issue, we are
- * safe to do this.
- */
- error = copystr(epp->ep_name, *tmpsap++,
- MAXPATHLEN, NULL);
+ else
+ /*
+ * Since systrace_scriptname() provides a
+ * convenience, not a security issue, we are
+ * safe to do this.
+ */
+ error = copystr(epp->ep_name, *tmpsap++,
+ MAXPATHLEN, NULL);
+ } else
+ error = copyinstr(epp->ep_name, *tmpsap++, MAXPATHLEN,
+ NULL);
#else
error = copyinstr(epp->ep_name, *tmpsap++, MAXPATHLEN,
(size_t *)0);