Project

General

Profile

Bug #1043 » recursive_dataset_destroy.patch

Patch - Martin Matuška, 2011-05-17 02:23 PM

View differences:

usr/src/uts/common/fs/zfs/zfs_ioctl.c Wed Apr 20 01:14:34 2011 -0400 → usr/src/uts/common/fs/zfs/zfs_ioctl.c Tue May 17 16:21:06 2011 +0200
685 685
 * and destroying snapshots requires descendent permissions, a successfull
686 686
 * check of the top level snapshot applies to snapshots of all descendent
687 687
 * datasets as well.
688
 *
689
 * The target snapshot may not exis when doing a recursive destroy.
690
 * In this case fallback to permissions of the parent dataset.
688 691
 */
689 692
static int
690 693
zfs_secpolicy_destroy_snaps(zfs_cmd_t *zc, cred_t *cr)
......
696 699

  
697 700
	error = zfs_secpolicy_destroy_perms(dsname, cr);
698 701

  
702
 	if (error == ENOENT)
703
 		error = zfs_secpolicy_destroy_perms(zc->zc_name, cr);
704

  
699 705
	strfree(dsname);
700 706
	return (error);
701 707
}
    (1-1/1)