Author: mav
Date: Sun Mar 20 20:33:03 2016
New Revision: 297084
URL: https://svnweb.freebsd.org/changeset/base/297084

Log:
  MFV r258597 (by pjd):
  When append-only, immutable or read-only flag is set don't allow for
  hard links creation. This matches UFS behaviour.
  
  Reported by:    Oleg Ginzburg <olev...@olevole.ru>

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c        
Sun Mar 20 20:31:30 2016        (r297083)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c        
Sun Mar 20 20:33:03 2016        (r297084)
@@ -4402,6 +4402,11 @@ zfs_link(vnode_t *tdvp, vnode_t *svp, ch
        szp = VTOZ(svp);
        ZFS_VERIFY_ZP(szp);
 
+       if (szp->z_pflags & (ZFS_APPENDONLY | ZFS_IMMUTABLE | ZFS_READONLY)) {
+               ZFS_EXIT(zfsvfs);
+               return (SET_ERROR(EPERM));
+       }
+
        /*
         * We check z_zfsvfs rather than v_vfsp here, because snapshots and the
         * ctldir appear to have the same v_vfsp.
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to