Illumos #1726: Removal of pyzfs broke delegation for volumes
[zfs.git] / cmd / zfs / zfs_main.c
index 3bcf626..7547b82 100644 (file)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2011 by Delphix. All rights reserved.
  */
 
@@ -4480,7 +4480,7 @@ parse_allow_args(int argc, char **argv, boolean_t un, struct allow_opts *opts)
                argc--;
                argv++;
                opts->dataset = munge_args(argc, argv, un, 2, &opts->perms);
-       } else if (argc == 1) {
+       } else if (argc == 1 && !un) {
                opts->prt_perms = B_TRUE;
                opts->dataset = argv[argc-1];
        } else {
@@ -4972,9 +4972,9 @@ zfs_do_allow_unallow_impl(int argc, char **argv, boolean_t un)
        parse_allow_args(argc, argv, un, &opts);
 
        /* try to open the dataset */
-       if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM))
-           == NULL) {
-               (void) fprintf(stderr, "Failed to open Dataset *%s*\n",
+       if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM |
+           ZFS_TYPE_VOLUME)) == NULL) {
+               (void) fprintf(stderr, "Failed to open dataset: %s\n",
                    opts.dataset);
                return (-1);
        }
@@ -4984,7 +4984,7 @@ zfs_do_allow_unallow_impl(int argc, char **argv, boolean_t un)
 
        fs_perm_set_init(&fs_perm_set);
        if (parse_fs_perm_set(&fs_perm_set, perm_nvl) != 0) {
-               (void) fprintf(stderr, "Failed to parse fsacl permissionsn");
+               (void) fprintf(stderr, "Failed to parse fsacl permissions\n");
                goto cleanup1;
        }