summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2009-12-08 20:47:10 +0000
committertrasz <trasz@FreeBSD.org>2009-12-08 20:47:10 +0000
commit110b737502be5dc3e6b90301262ce0c02959c7d3 (patch)
tree141d0f8528a9617bb8ab6debc1fae114c16b39f4 /sys/kern/vfs_vnops.c
parente888c6f864ef40440287949376c4e869a07f8b68 (diff)
downloadFreeBSD-src-110b737502be5dc3e6b90301262ce0c02959c7d3.zip
FreeBSD-src-110b737502be5dc3e6b90301262ce0c02959c7d3.tar.gz
Don't add VAPPEND if the file is not being opened for writing. Note that this
only affects cases where open(2) is being used improperly - i.e. when the user specifies O_APPEND without O_WRONLY or O_RDWR. Reviewed by: rwatson
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 03e8d93..d0b713c 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -212,7 +212,7 @@ restart:
accmode |= VREAD;
if (fmode & FEXEC)
accmode |= VEXEC;
- if (fmode & O_APPEND)
+ if ((fmode & O_APPEND) && (fmode & FWRITE))
accmode |= VAPPEND;
#ifdef MAC
error = mac_vnode_check_open(cred, vp, accmode);
OpenPOWER on IntegriCloud