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.
This commit is contained in:
Edward Tomasz Napierala 2009-11-04 06:47:14 +00:00
parent c346328f95
commit 597954c813

View File

@ -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));
}