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))) {
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to