diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1997-03-29 20:10:02 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1997-03-29 20:10:02 +0000 |
commit | a597a4c53b1759ef6b541da591ae009dd66cf529 (patch) | |
tree | ba9a2771ce6b6e4f7743f13acd83e81bac6a07a6 /sys/kern/kern_exec.c | |
parent | 652b1e69e91a5089e4e9436459488bcc0bff0fad (diff) |
Return EISDIR for directories; idea from NetBSD
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 6 |
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; |