Skip to content

Commit

Permalink
fixup: check ZFS_DELEG_PERM_USERPROP only if there are any properties
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Gapon <[email protected]>
  • Loading branch information
avg-I committed Aug 21, 2019
1 parent 6524a09 commit a14f896
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3491,12 +3491,14 @@ zfs_ioc_snapshot(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl)
/*
* Check for permission to set the properties on the fs.
*/
*cp = '\0';
error = zfs_secpolicy_write_perms(name, ZFS_DELEG_PERM_USERPROP,
CRED());
*cp = '@';
if (error != 0)
return (error);
if (!nvlist_empty(props)) {
*cp = '\0';
error = zfs_secpolicy_write_perms(name,
ZFS_DELEG_PERM_USERPROP, CRED());
*cp = '@';
if (error != 0)
return (error);
}

/* This must be the only snap of this fs. */
for (nvpair_t *pair2 = nvlist_next_nvpair(snaps, pair);
Expand Down

0 comments on commit a14f896

Please sign in to comment.