summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_syscalls.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_syscalls.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_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 0a8ef46..eb5fb87 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -4426,7 +4426,7 @@ fhopen(td, uap)
}
if (fmode & FREAD)
accmode |= VREAD;
- if (fmode & O_APPEND)
+ if ((fmode & O_APPEND) && (fmode & FWRITE))
accmode |= VAPPEND;
#ifdef MAC
error = mac_vnode_check_open(td->td_ucred, vp, accmode);
OpenPOWER on IntegriCloud