1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 #ifndef _SYS_DSL_PERMS_H 27 #define _SYS_DSL_PERMS_H 28 29 #pragma ident "%Z%%M% %I% %E% SMI" 30 31 #include <sys/dmu.h> 32 #include <sys/dsl_pool.h> 33 #include <sys/zfs_context.h> 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 #define ZFS_DELEG_PERM_NONE "" 40 #define ZFS_DELEG_PERM_CREATE "create" 41 #define ZFS_DELEG_PERM_DESTROY "destroy" 42 #define ZFS_DELEG_PERM_SNAPSHOT "snapshot" 43 #define ZFS_DELEG_PERM_ROLLBACK "rollback" 44 #define ZFS_DELEG_PERM_CLONE "clone" 45 #define ZFS_DELEG_PERM_PROMOTE "promote" 46 #define ZFS_DELEG_PERM_RENAME "rename" 47 #define ZFS_DELEG_PERM_MOUNT "mount" 48 #define ZFS_DELEG_PERM_SHARE "share" 49 #define ZFS_DELEG_PERM_SEND "send" 50 #define ZFS_DELEG_PERM_RECEIVE "receive" 51 #define ZFS_DELEG_PERM_QUOTA "quota" 52 #define ZFS_DELEG_PERM_RESERVATION "reservation" 53 #define ZFS_DELEG_PERM_VOLSIZE "volsize" 54 #define ZFS_DELEG_PERM_RECORDSIZE "recordsize" 55 #define ZFS_DELEG_PERM_MOUNTPOINT "mountpoint" 56 #define ZFS_DELEG_PERM_SHARENFS "sharenfs" 57 #define ZFS_DELEG_PERM_CHECKSUM "checksum" 58 #define ZFS_DELEG_PERM_COMPRESSION "compression" 59 #define ZFS_DELEG_PERM_ATIME "atime" 60 #define ZFS_DELEG_PERM_DEVICES "devices" 61 #define ZFS_DELEG_PERM_EXEC "exec" 62 #define ZFS_DELEG_PERM_SETUID "setuid" 63 #define ZFS_DELEG_PERM_READONLY "readonly" 64 #define ZFS_DELEG_PERM_ZONED "zoned" 65 #define ZFS_DELEG_PERM_SNAPDIR "snapdir" 66 #define ZFS_DELEG_PERM_ACLMODE "aclmode" 67 #define ZFS_DELEG_PERM_ACLINHERIT "aclinherit" 68 #define ZFS_DELEG_PERM_ALLOW "allow" 69 #define ZFS_DELEG_PERM_CANMOUNT "canmount" 70 #define ZFS_DELEG_PERM_USERPROP "userprop" 71 #define ZFS_DELEG_PERM_SHAREISCSI "shareiscsi" 72 #define ZFS_DELEG_PERM_XATTR "xattr" 73 #define ZFS_DELEG_PERM_COPIES "copies" 74 #define ZFS_DELEG_PERM_VERSION "version" 75 76 int dsl_deleg_get(const char *ddname, nvlist_t **nvp); 77 int dsl_deleg_set(const char *ddname, nvlist_t *nvp, boolean_t unset); 78 int dsl_deleg_access(const char *ddname, const char *perm, cred_t *cr); 79 void dsl_deleg_set_create_perms(dsl_dir_t *dd, dmu_tx_t *tx, cred_t *cr); 80 int dsl_deleg_can_allow(char *ddname, nvlist_t *nvp, cred_t *cr); 81 int dsl_deleg_can_unallow(char *ddname, nvlist_t *nvp, cred_t *cr); 82 int dsl_deleg_destroy(objset_t *os, uint64_t zapobj, dmu_tx_t *tx); 83 boolean_t dsl_delegation_on(objset_t *os); 84 85 #ifdef __cplusplus 86 } 87 #endif 88 89 #endif /* _SYS_DSL_PERMS_H */ 90