aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2009-11-04 06:47:14 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2009-11-04 06:47:14 +0000
commit597954c813a7afdae481e233375f7494c4a7c1d2 (patch)
treeb0f57a4d30f3efa620afdd3fd9275343d4f9778a /sys
parentc346328f95027d94e50394c8009f6f201c00c265 (diff)
downloadsrc-597954c813a7afdae481e233375f7494c4a7c1d2.tar.gz
src-597954c813a7afdae481e233375f7494c4a7c1d2.zip
While VAPPEND without VWRITE makes sense for VOP_ACCESSX(9) (e.g. to check
for the permission to create subdirectory (ACE4_ADD_SUBDIRECTORY)), it doesn't really make sense for VOP_ACCESS(9). Also, many VOP_ACCESS(9) implementations don't expect that. Make sure we don't confuse them.
Notes
Notes: svn path=/head/; revision=198873
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_default.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index b80d03d0e9ec..d37e0662f266 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -353,6 +353,14 @@ vop_stdaccessx(struct vop_accessx_args *ap)
if (accmode == 0)
return (0);
+ /*
+ * Many VOP_APPEND implementations don't expect VAPPEND without VWRITE
+ * being set, e.g. they check whether the filesystem is read-only only
+ * when VWRITE is set. Make sure we don't confuse them.
+ */
+ if (accmode & VAPPEND)
+ accmode |= VWRITE;
+
return (VOP_ACCESS(ap->a_vp, accmode, ap->a_cred, ap->a_td));
}