svn commit: r198873 - head/sys/kern

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed Nov 4 07:07:50 UTC 2009


On Wed, Nov 04, 2009 at 06:47:14AM +0000, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Wed Nov  4 06:47:14 2009
> New Revision: 198873
> URL: http://svn.freebsd.org/changeset/base/198873
> 
> Log:
>   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.
> 
> Modified:
>   head/sys/kern/vfs_default.c
> 
> Modified: head/sys/kern/vfs_default.c
> ==============================================================================
> --- head/sys/kern/vfs_default.c	Wed Nov  4 04:41:03 2009	(r198872)
> +++ head/sys/kern/vfs_default.c	Wed Nov  4 06:47:14 2009	(r198873)
> @@ -353,6 +353,14 @@ vop_stdaccessx(struct vop_accessx_args *
>  	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.

But O_APPEND alone is legal and doesn't provide write access. This is
fine for file systems to only check for read-only in VWRITE case.
If file system you're talking about is ZFS it was simply a bug in ZFS.

> +	 */
> +	if (accmode & VAPPEND)
> +		accmode |= VWRITE;
>  	return (VOP_ACCESS(ap->a_vp, accmode, ap->a_cred, ap->a_td));

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20091104/741e15fc/attachment-0001.pgp


More information about the svn-src-head mailing list