diff options
author | pjd <pjd@FreeBSD.org> | 2010-04-22 18:47:23 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-04-22 18:47:23 +0000 |
commit | 811be862d0fc3cf0d7225fc542e805a6efb93b30 (patch) | |
tree | 9c73d29015463351cc7fc15a1c06105ec10a3999 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c | |
parent | 50a4503e464790a7d2b96bb43ebb5094d8f430d8 (diff) | |
download | FreeBSD-src-811be862d0fc3cf0d7225fc542e805a6efb93b30.zip FreeBSD-src-811be862d0fc3cf0d7225fc542e805a6efb93b30.tar.gz |
Allow to modify directory's content even if the ZFS_NOUNLINK (SF_NOUNLINK,
sunlnk) flag is set. We only deny dirctory's removal or rename.
PR: kern/143343
Reported by: marck
MFC after: 3 days
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c | 13 |
1 files changed, 13 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 eb93721..9825d83 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 @@ -2235,11 +2235,24 @@ zfs_zaccess_common(znode_t *zp, uint32_t v4_mode, uint32_t *working_mode, return (EPERM); } +#ifdef sun if ((v4_mode & (ACE_DELETE | ACE_DELETE_CHILD)) && (zp->z_phys->zp_flags & ZFS_NOUNLINK)) { *check_privs = B_FALSE; return (EPERM); } +#else + /* + * In FreeBSD we allow to modify directory's content is ZFS_NOUNLINK + * (sunlnk) is set. We just don't allow directory removal, which is + * handled in zfs_zaccess_delete(). + */ + if ((v4_mode & ACE_DELETE) && + (zp->z_phys->zp_flags & ZFS_NOUNLINK)) { + *check_privs = B_FALSE; + return (EPERM); + } +#endif if (((v4_mode & (ACE_READ_DATA|ACE_EXECUTE)) && (zp->z_phys->zp_flags & ZFS_AV_QUARANTINED))) { |