diff options
author | William Gorrell <william.gorrell@sun.com> | 2009-06-11 13:53:29 -0600 |
---|---|---|
committer | William Gorrell <william.gorrell@sun.com> | 2009-06-11 13:53:29 -0600 |
commit | 8b33e2134db3b64f2e6c6eae17656c335ad99add (patch) | |
tree | e1d5e2cf777e46ff47b7d1162216ad2ce0ac36eb /usr/src | |
parent | f64c0e34235c0ee36e44e9ff1cf0cd3764ed227d (diff) | |
download | illumos-gate-8b33e2134db3b64f2e6c6eae17656c335ad99add.tar.gz |
6809340 snapshots should be considered as descendants via zfs allow -d
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/fs/zfs/dsl_deleg.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr/src/uts/common/fs/zfs/dsl_deleg.c b/usr/src/uts/common/fs/zfs/dsl_deleg.c index da5d157875..5d76ff5f9d 100644 --- a/usr/src/uts/common/fs/zfs/dsl_deleg.c +++ b/usr/src/uts/common/fs/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)); |