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 (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
23  * Copyright 2015, Joyent, Inc. All rights reserved.
24  *
25  * Privilege constant definitions; these constants are subject to
26  * change, including renumbering, without notice and should not be
27  * used in any code.  Privilege names must be used instead.
28  * Privileges and privilege sets must not be stored in binary
29  * form; privileges and privileges sets must be converted to
30  * textual representation before being committed to persistent store.
31  *
32  * THIS FILE WAS GENERATED; DO NOT EDIT
33  */
34 
35 
36 #ifndef _SYS_PRIV_CONST_H
37 #define	_SYS_PRIV_CONST_H
38 
39 
40 
41 
42 #include <sys/types.h>
43 
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #if defined(_KERNEL) || defined(_KMEMUSER)
50 #define	PRIV_NSET			  4
51 #define	PRIV_SETSIZE			  3
52 #endif
53 
54 #ifdef _KERNEL
55 #define	__PRIV_CONST_IMPL
56 
57 extern const char *priv_names[];
58 extern const char *priv_setnames[];
59 extern int nprivs;
60 extern int privbytes;
61 extern int maxprivbytes;
62 extern size_t privinfosize;
63 extern char *priv_str;
64 extern struct priv_set *priv_basic;
65 extern struct priv_impl_info *priv_info;
66 extern struct priv_info_names *priv_ninfo;
67 
68 /* Privileges */
69 #define	PRIV_CONTRACT_EVENT	  0
70 #define	PRIV_CONTRACT_IDENTITY	  1
71 #define	PRIV_CONTRACT_OBSERVER	  2
72 #define	PRIV_CPC_CPU		  3
73 #define	PRIV_DTRACE_KERNEL	  4
74 #define	PRIV_DTRACE_PROC	  5
75 #define	PRIV_DTRACE_USER	  6
76 #define	PRIV_FILE_CHOWN		  7
77 #define	PRIV_FILE_CHOWN_SELF	  8
78 #define	PRIV_FILE_DAC_EXECUTE	  9
79 #define	PRIV_FILE_DAC_READ	 10
80 #define	PRIV_FILE_DAC_SEARCH	 11
81 #define	PRIV_FILE_DAC_WRITE	 12
82 #define	PRIV_FILE_DOWNGRADE_SL	 13
83 #define	PRIV_FILE_FLAG_SET	 14
84 #define	PRIV_FILE_LINK_ANY	 15
85 #define	PRIV_FILE_OWNER		 16
86 #define	PRIV_FILE_READ		 17
87 #define	PRIV_FILE_SETID		 18
88 #define	PRIV_FILE_UPGRADE_SL	 19
89 #define	PRIV_FILE_WRITE		 20
90 #define	PRIV_GRAPHICS_ACCESS	 21
91 #define	PRIV_GRAPHICS_MAP	 22
92 #define	PRIV_IPC_DAC_READ	 23
93 #define	PRIV_IPC_DAC_WRITE	 24
94 #define	PRIV_IPC_OWNER		 25
95 #define	PRIV_NET_ACCESS		 26
96 #define	PRIV_NET_BINDMLP	 27
97 #define	PRIV_NET_ICMPACCESS	 28
98 #define	PRIV_NET_MAC_AWARE	 29
99 #define	PRIV_NET_MAC_IMPLICIT	 30
100 #define	PRIV_NET_OBSERVABILITY	 31
101 #define	PRIV_NET_PRIVADDR	 32
102 #define	PRIV_NET_RAWACCESS	 33
103 #define	PRIV_PROC_AUDIT		 34
104 #define	PRIV_PROC_CHROOT	 35
105 #define	PRIV_PROC_CLOCK_HIGHRES	 36
106 #define	PRIV_PROC_EXEC		 37
107 #define	PRIV_PROC_FORK		 38
108 #define	PRIV_PROC_INFO		 39
109 #define	PRIV_PROC_LOCK_MEMORY	 40
110 #define	PRIV_PROC_MEMINFO	 41
111 #define	PRIV_PROC_OWNER		 42
112 #define	PRIV_PROC_PRIOUP	 43
113 #define	PRIV_PROC_PRIOCNTL	 44
114 #define	PRIV_PROC_SESSION	 45
115 #define	PRIV_PROC_SETID		 46
116 #define	PRIV_PROC_TASKID	 47
117 #define	PRIV_PROC_ZONE		 48
118 #define	PRIV_SYS_ACCT		 49
119 #define	PRIV_SYS_ADMIN		 50
120 #define	PRIV_SYS_AUDIT		 51
121 #define	PRIV_SYS_CONFIG		 52
122 #define	PRIV_SYS_DEVICES	 53
123 #define	PRIV_SYS_IPC_CONFIG	 54
124 #define	PRIV_SYS_LINKDIR	 55
125 #define	PRIV_SYS_MOUNT		 56
126 #define	PRIV_SYS_IPTUN_CONFIG	 57
127 #define	PRIV_SYS_DL_CONFIG	 58
128 #define	PRIV_SYS_IP_CONFIG	 59
129 #define	PRIV_SYS_NET_CONFIG	 60
130 #define	PRIV_SYS_NFS		 61
131 #define	PRIV_SYS_PPP_CONFIG	 62
132 #define	PRIV_SYS_RES_BIND	 63
133 #define	PRIV_SYS_RES_CONFIG	 64
134 #define	PRIV_SYS_RESOURCE	 65
135 #define	PRIV_SYS_SMB		 66
136 #define	PRIV_SYS_SUSER_COMPAT	 67
137 #define	PRIV_SYS_TIME		 68
138 #define	PRIV_SYS_TRANS_LABEL	 69
139 #define	PRIV_VIRT_MANAGE	 70
140 #define	PRIV_WIN_COLORMAP	 71
141 #define	PRIV_WIN_CONFIG		 72
142 #define	PRIV_WIN_DAC_READ	 73
143 #define	PRIV_WIN_DAC_WRITE	 74
144 #define	PRIV_WIN_DEVICES	 75
145 #define	PRIV_WIN_DGA		 76
146 #define	PRIV_WIN_DOWNGRADE_SL	 77
147 #define	PRIV_WIN_FONTPATH	 78
148 #define	PRIV_WIN_MAC_READ	 79
149 #define	PRIV_WIN_MAC_WRITE	 80
150 #define	PRIV_WIN_SELECTION	 81
151 #define	PRIV_WIN_UPGRADE_SL	 82
152 #define	PRIV_XVM_CONTROL	 83
153 
154 /* Privilege sets */
155 #define	PRIV_EFFECTIVE		  0
156 #define	PRIV_INHERITABLE	  1
157 #define	PRIV_PERMITTED		  2
158 #define	PRIV_LIMIT		  3
159 
160 #define	MAX_PRIVILEGE			 96
161 
162 #define	PRIV_UNSAFE_ASSERT(set)\
163 		PRIV_ASSERT((set), PRIV_PROC_AUDIT);\
164 		PRIV_ASSERT((set), PRIV_PROC_SETID);\
165 		PRIV_ASSERT((set), PRIV_SYS_RESOURCE)
166 
167 #define	PRIV_BASIC_ASSERT(set)\
168 		PRIV_ASSERT((set), PRIV_FILE_LINK_ANY);\
169 		PRIV_ASSERT((set), PRIV_FILE_READ);\
170 		PRIV_ASSERT((set), PRIV_FILE_WRITE);\
171 		PRIV_ASSERT((set), PRIV_NET_ACCESS);\
172 		PRIV_ASSERT((set), PRIV_PROC_EXEC);\
173 		PRIV_ASSERT((set), PRIV_PROC_FORK);\
174 		PRIV_ASSERT((set), PRIV_PROC_INFO);\
175 		PRIV_ASSERT((set), PRIV_PROC_SESSION)
176 
177 #endif /* _KERNEL */
178 
179 #ifdef __cplusplus
180 }
181 #endif
182 
183 #endif /* _SYS_PRIV_CONST_H */
184