diff options
author | Brian Behlendorf <[email protected]> | 2009-08-18 11:43:27 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-08-18 11:43:27 -0700 |
commit | 45d1cae3b8c949ecc391dd7a5b81963b34c71c29 (patch) | |
tree | 69b1f860eb1f9b1ebdef392760814c5cc089f345 /module/zfs/dsl_deleg.c | |
parent | 9babb37438b58e77bad04e820d5702e15b79e6a6 (diff) |
Rebase master to b121
Diffstat (limited to 'module/zfs/dsl_deleg.c')
-rw-r--r-- | module/zfs/dsl_deleg.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/module/zfs/dsl_deleg.c b/module/zfs/dsl_deleg.c index da5d15787..5d76ff5f9 100644 --- a/module/zfs/dsl_deleg.c +++ b/module/zfs/dsl_deleg.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -66,8 +66,6 @@ * The ZAP OBJ is referred to as the jump object. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/dmu.h> #include <sys/dmu_objset.h> #include <sys/dmu_tx.h> @@ -540,7 +538,7 @@ dsl_deleg_access(const char *dsname, const char *perm, cred_t *cr) dsl_pool_t *dp; void *cookie; int error; - char checkflag = ZFS_DELEG_LOCAL; + char checkflag; objset_t *mos; avl_tree_t permsets; perm_set_t *setnode; @@ -563,6 +561,16 @@ dsl_deleg_access(const char *dsname, const char *perm, cred_t *cr) return (EPERM); } + if (dsl_dataset_is_snapshot(ds)) { + /* + * Snapshots are treated as descendents only, + * local permissions do not apply. + */ + checkflag = ZFS_DELEG_DESCENDENT; + } else { + checkflag = ZFS_DELEG_LOCAL; + } + avl_create(&permsets, perm_set_compare, sizeof (perm_set_t), offsetof(perm_set_t, p_node)); |