5330
5331 if (opts.prt_perms)
5332 print_fs_perms(&fs_perm_set);
5333 else {
5334 (void) construct_fsacl_list(un, &opts, &update_perm_nvl);
5335 if (zfs_set_fsacl(zhp, un, update_perm_nvl) != 0)
5336 goto cleanup0;
5337
5338 if (un && opts.recursive) {
5339 struct deleg_perms data = { un, update_perm_nvl };
5340 if (zfs_iter_filesystems(zhp, set_deleg_perms,
5341 &data) != 0)
5342 goto cleanup0;
5343 }
5344 }
5345
5346 error = 0;
5347
5348 cleanup0:
5349 nvlist_free(perm_nvl);
5350 if (update_perm_nvl != NULL)
5351 nvlist_free(update_perm_nvl);
5352 cleanup1:
5353 fs_perm_set_fini(&fs_perm_set);
5354 cleanup2:
5355 zfs_close(zhp);
5356
5357 return (error);
5358 }
5359
5360 static int
5361 zfs_do_allow(int argc, char **argv)
5362 {
5363 return (zfs_do_allow_unallow_impl(argc, argv, B_FALSE));
5364 }
5365
5366 static int
5367 zfs_do_unallow(int argc, char **argv)
5368 {
5369 return (zfs_do_allow_unallow_impl(argc, argv, B_TRUE));
5370 }
|
5330
5331 if (opts.prt_perms)
5332 print_fs_perms(&fs_perm_set);
5333 else {
5334 (void) construct_fsacl_list(un, &opts, &update_perm_nvl);
5335 if (zfs_set_fsacl(zhp, un, update_perm_nvl) != 0)
5336 goto cleanup0;
5337
5338 if (un && opts.recursive) {
5339 struct deleg_perms data = { un, update_perm_nvl };
5340 if (zfs_iter_filesystems(zhp, set_deleg_perms,
5341 &data) != 0)
5342 goto cleanup0;
5343 }
5344 }
5345
5346 error = 0;
5347
5348 cleanup0:
5349 nvlist_free(perm_nvl);
5350 nvlist_free(update_perm_nvl);
5351 cleanup1:
5352 fs_perm_set_fini(&fs_perm_set);
5353 cleanup2:
5354 zfs_close(zhp);
5355
5356 return (error);
5357 }
5358
5359 static int
5360 zfs_do_allow(int argc, char **argv)
5361 {
5362 return (zfs_do_allow_unallow_impl(argc, argv, B_FALSE));
5363 }
5364
5365 static int
5366 zfs_do_unallow(int argc, char **argv)
5367 {
5368 return (zfs_do_allow_unallow_impl(argc, argv, B_TRUE));
5369 }
|