From: tholo Date: Sat, 29 Mar 1997 20:10:01 +0000 (+0000) Subject: Return EISDIR for directories; idea from NetBSD X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=68bf78978337b56a32e5447f8cb68ad8a5d6d6be;p=openbsd Return EISDIR for directories; idea from NetBSD --- 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;