diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-12-10 19:15:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-12-10 19:15:10 +0000 |
commit | 6d65b9c0fbe93ab4e12d9c8ea80526088dd39769 (patch) | |
tree | ab364979603616cbda2af057f9b816f24dab87ac /sys/kern/vfs_vnops.c | |
parent | cc28c61376bcba28e0ac0be3cede11ff44001e53 (diff) |
only permit O_TRUNC if FWRITE is set; chatted about by millert and myself for nearly an hour
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r-- | sys/kern/vfs_vnops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index c61e2f45719..0fe684c8397 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_vnops.c,v 1.9 1997/11/06 05:58:29 csapuntz Exp $ */ +/* $OpenBSD: vfs_vnops.c,v 1.10 1997/12/10 19:15:09 deraadt Exp $ */ /* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */ /* @@ -124,7 +124,7 @@ vn_open(ndp, fmode, cmode) if ((error = VOP_ACCESS(vp, VREAD, cred, p)) != 0) goto bad; } - if (fmode & (FWRITE | O_TRUNC)) { + if ((fmode & (FWRITE | O_TRUNC)) == (FWRITE | O_TRUNC)) { if (vp->v_type == VDIR) { error = EISDIR; goto bad; |