Require write access on a directory being moved from one parent

directory to another in ZFS.

Approved by:	rwatson (mentor), pjd
This commit is contained in:
trasz 2008-11-08 19:56:32 +00:00
parent 968a3d70d8
commit 47921f147e

View File

@ -1580,7 +1580,15 @@ zfs_zaccess_rename(znode_t *sdzp, znode_t *szp, znode_t *tdzp,
/*
* Rename permissions are combination of delete permission +
* add file/subdir permission.
*
* BSD operating systems also require write permission
* on the directory being moved from one parent directory
* to another.
*/
if (ZTOV(szp)->v_type == VDIR && ZTOV(sdzp) != ZTOV(tdzp)) {
if (error = zfs_zaccess(szp, ACE_WRITE_DATA, cr))
return (error);
}
/*
* first make sure we do the delete portion.