svn commit: r207068 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

[ Available lists | Index of svn-src-all | Month of Apr 2010 | Week of 22 Apr 2010 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Pawel Jakub Dawidek <pjd@FreeBSD.org>
Date
22 Apr 2010 18:47:24
Subject
svn commit: r207068 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID
201004221847.o3MIlNxa060437@svn.freebsd.org


[ Hide this part ]
Author: pjd
Date: Thu Apr 22 18:47:23 2010
New Revision: 207068
URL: http://svn.freebsd.org/changeset/base/207068

Log:
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

Modified:
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Apr 22 18:44:23 2010 (r207067)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Apr 22 18:47:23 2010 (r207068)
@@ -2235,11 +2235,24 @@ zfs_zaccess_common(znode_t *zp, uint32_t
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))) {


Elapsed time: 0.056 seconds