Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Mar 2016 20:33:03 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r297084 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201603202033.u2KKX3cb065201@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <olevole@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603202033.u2KKX3cb065201>