diff options
author | trasz <trasz@FreeBSD.org> | 2008-11-06 19:17:58 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2008-11-06 19:17:58 +0000 |
commit | 5ec338f603bfe525c857887fc437719a2f20df81 (patch) | |
tree | 0b19095cf5a1cebdbac71344217648ea8380ef5d /sys/cddl | |
parent | ff5dcb8a8b07e206fe94e7f16221124521d87511 (diff) | |
download | FreeBSD-src-5ec338f603bfe525c857887fc437719a2f20df81.zip FreeBSD-src-5ec338f603bfe525c857887fc437719a2f20df81.tar.gz |
Change ZFS behaviour to match UFS: when moving (rename(2)) a subdirectory
from one parent directory to another, in addition to the usual access checks
one also needs write access to the subdirectory being moved.
Approved by: rwatson (mentor), pjd
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c index dd94618..df0db5f 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c @@ -1580,7 +1580,14 @@ 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. */ + if (ZTOV(szp)->v_type == VDIR) { + if (error = zfs_zaccess(szp, ACE_WRITE_DATA, cr)) + return (error); + } /* * first make sure we do the delete portion. |