1 // SPDX-License-Identifier: CDDL-1.0 2 /* 3 * This file and its contents are supplied under the terms of the 4 * Common Development and Distribution License ("CDDL"), version 1.0. 5 * You may only use this file in accordance with the terms of version 6 * 1.0 of the CDDL. 7 * 8 * A full copy of the text of the CDDL should have accompanied this 9 * source. A copy of the CDDL is also available via the Internet at 10 * https://opensource.org/license/CDDL-1.0. 11 */ 12 /* 13 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 14 * Copyright 2010 Nexenta Systems, Inc. All rights reserved. 15 * Copyright (c) 2013, 2015 by Delphix. All rights reserved. 16 */ 17 18 #ifndef _ZFS_DELEG_H 19 #define _ZFS_DELEG_H extern __attribute__((visibility("default"))) 20 21 #include <sys/fs/zfs.h> 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 #define ZFS_DELEG_SET_NAME_CHR '@' /* set name lead char */ 28 #define ZFS_DELEG_FIELD_SEP_CHR '$' /* field separator */ 29 30 /* 31 * Max name length for a delegation attribute 32 */ 33 #define ZFS_MAX_DELEG_NAME 128 34 35 #define ZFS_DELEG_LOCAL 'l' 36 #define ZFS_DELEG_DESCENDENT 'd' 37 #define ZFS_DELEG_NA '-' 38 39 typedef enum { 40 ZFS_DELEG_NOTE_CREATE, 41 ZFS_DELEG_NOTE_DESTROY, 42 ZFS_DELEG_NOTE_SNAPSHOT, 43 ZFS_DELEG_NOTE_ROLLBACK, 44 ZFS_DELEG_NOTE_CLONE, 45 ZFS_DELEG_NOTE_PROMOTE, 46 ZFS_DELEG_NOTE_RENAME, 47 ZFS_DELEG_NOTE_SEND, 48 ZFS_DELEG_NOTE_SEND_RAW, 49 ZFS_DELEG_NOTE_SEND_ENCRYPTED, 50 ZFS_DELEG_NOTE_RECEIVE, 51 ZFS_DELEG_NOTE_ALLOW, 52 ZFS_DELEG_NOTE_USERPROP, 53 ZFS_DELEG_NOTE_MOUNT, 54 ZFS_DELEG_NOTE_SHARE, 55 ZFS_DELEG_NOTE_USERQUOTA, 56 ZFS_DELEG_NOTE_GROUPQUOTA, 57 ZFS_DELEG_NOTE_USERUSED, 58 ZFS_DELEG_NOTE_GROUPUSED, 59 ZFS_DELEG_NOTE_USEROBJQUOTA, 60 ZFS_DELEG_NOTE_GROUPOBJQUOTA, 61 ZFS_DELEG_NOTE_USEROBJUSED, 62 ZFS_DELEG_NOTE_GROUPOBJUSED, 63 ZFS_DELEG_NOTE_HOLD, 64 ZFS_DELEG_NOTE_RELEASE, 65 ZFS_DELEG_NOTE_DIFF, 66 ZFS_DELEG_NOTE_BOOKMARK, 67 ZFS_DELEG_NOTE_LOAD_KEY, 68 ZFS_DELEG_NOTE_CHANGE_KEY, 69 ZFS_DELEG_NOTE_PROJECTUSED, 70 ZFS_DELEG_NOTE_PROJECTQUOTA, 71 ZFS_DELEG_NOTE_PROJECTOBJUSED, 72 ZFS_DELEG_NOTE_PROJECTOBJQUOTA, 73 ZFS_DELEG_NOTE_NONE 74 } zfs_deleg_note_t; 75 76 typedef struct zfs_deleg_perm_tab { 77 const char *z_perm; 78 zfs_deleg_note_t z_note; 79 } zfs_deleg_perm_tab_t; 80 81 _ZFS_DELEG_H const zfs_deleg_perm_tab_t zfs_deleg_perm_tab[]; 82 83 _ZFS_DELEG_H int zfs_deleg_verify_nvlist(nvlist_t *nvlist); 84 _ZFS_DELEG_H void zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type, 85 char checkflag, void *data); 86 _ZFS_DELEG_H const char *zfs_deleg_canonicalize_perm(const char *perm); 87 88 #ifdef __cplusplus 89 } 90 #endif 91 92 #endif /* _ZFS_DELEG_H */ 93