summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1997-03-29 20:10:01 +0000
committertholo <tholo@openbsd.org>1997-03-29 20:10:01 +0000
commit68bf78978337b56a32e5447f8cb68ad8a5d6d6be (patch)
treee5c5d9b979c15a3725f070c636dfc4b405bab950
parentDocument EINVAL; from NetBSD PR 3395 (diff)
downloadwireguard-openbsd-68bf78978337b56a32e5447f8cb68ad8a5d6d6be.tar.xz
wireguard-openbsd-68bf78978337b56a32e5447f8cb68ad8a5d6d6be.zip
Return EISDIR for directories; idea from NetBSD
-rw-r--r--sys/kern/kern_exec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 7f06d1743be..ee48242bb31 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.8 1997/02/18 00:16:05 deraadt Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.9 1997/03/29 20:10:01 tholo Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -106,6 +106,10 @@ check_exec(p, epp)
epp->ep_vp = vp = ndp->ni_vp;
/* check for regular file */
+ if (vp->v_type == VDIR) {
+ error = EISDIR;
+ goto bad1;
+ }
if (vp->v_type != VREG) {
error = EACCES;
goto bad1;