1 | /*
|
---|
2 | Unix SMB/CIFS implementation.
|
---|
3 | SMB parameters and setup
|
---|
4 | Copyright (C) Andrew Tridgell 1992-2000
|
---|
5 | Copyright (C) Luke Kenneth Casson Leighton 1996-2000
|
---|
6 |
|
---|
7 | This program is free software; you can redistribute it and/or modify
|
---|
8 | it under the terms of the GNU General Public License as published by
|
---|
9 | the Free Software Foundation; either version 2 of the License, or
|
---|
10 | (at your option) any later version.
|
---|
11 |
|
---|
12 | This program is distributed in the hope that it will be useful,
|
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | GNU General Public License for more details.
|
---|
16 |
|
---|
17 | You should have received a copy of the GNU General Public License
|
---|
18 | along with this program; if not, write to the Free Software
|
---|
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef _RPC_SECDES_H /* _RPC_SECDES_H */
|
---|
23 | #define _RPC_SECDES_H
|
---|
24 |
|
---|
25 | /* for ADS */
|
---|
26 | #define SEC_RIGHTS_LIST_CONTENTS 0x4
|
---|
27 | #define SEC_RIGHTS_LIST_OBJECT 0x80
|
---|
28 | #define SEC_RIGHTS_READ_ALL_PROP 0x10
|
---|
29 | #define SEC_RIGHTS_READ_PERMS 0x20000
|
---|
30 | #define SEC_RIGHTS_WRITE_ALL_VALID 0x8
|
---|
31 | #define SEC_RIGHTS_WRITE_ALL_PROP 0x20
|
---|
32 | #define SEC_RIGHTS_MODIFY_OWNER 0x80000
|
---|
33 | #define SEC_RIGHTS_MODIFY_PERMS 0x40000
|
---|
34 | #define SEC_RIGHTS_CREATE_CHILD 0x1
|
---|
35 | #define SEC_RIGHTS_DELETE_CHILD 0x2
|
---|
36 | #define SEC_RIGHTS_DELETE_SUBTREE 0x40
|
---|
37 | #define SEC_RIGHTS_DELETE 0x10000 /* advanced/special/object/delete */
|
---|
38 | #define SEC_RIGHTS_EXTENDED 0x100 /* change/reset password, receive/send as*/
|
---|
39 | #define SEC_RIGHTS_CHANGE_PASSWD SEC_RIGHTS_EXTENDED
|
---|
40 | #define SEC_RIGHTS_RESET_PASSWD SEC_RIGHTS_EXTENDED
|
---|
41 | #define SEC_RIGHTS_FULL_CTRL 0xf01ff
|
---|
42 |
|
---|
43 | #define SEC_ACE_OBJECT_PRESENT 0x00000001 /* thanks for Jim McDonough <jmcd@us.ibm.com> */
|
---|
44 | #define SEC_ACE_OBJECT_INHERITED_PRESENT 0x00000002
|
---|
45 |
|
---|
46 | /*
|
---|
47 | * New Windows 2000 bits.
|
---|
48 | */
|
---|
49 | #define SE_DESC_DACL_AUTO_INHERIT_REQ 0x0100
|
---|
50 | #define SE_DESC_SACL_AUTO_INHERIT_REQ 0x0200
|
---|
51 | #define SE_DESC_DACL_AUTO_INHERITED 0x0400
|
---|
52 | #define SE_DESC_SACL_AUTO_INHERITED 0x0800
|
---|
53 | #define SE_DESC_DACL_PROTECTED 0x1000
|
---|
54 | #define SE_DESC_SACL_PROTECTED 0x2000
|
---|
55 |
|
---|
56 | /* security information */
|
---|
57 | #define OWNER_SECURITY_INFORMATION 0x00000001
|
---|
58 | #define GROUP_SECURITY_INFORMATION 0x00000002
|
---|
59 | #define DACL_SECURITY_INFORMATION 0x00000004
|
---|
60 | #define SACL_SECURITY_INFORMATION 0x00000008
|
---|
61 | /* Extra W2K flags. */
|
---|
62 | #define UNPROTECTED_SACL_SECURITY_INFORMATION 0x10000000
|
---|
63 | #define UNPROTECTED_DACL_SECURITY_INFORMATION 0x20000000
|
---|
64 | #define PROTECTED_SACL_SECURITY_INFORMATION 0x40000000
|
---|
65 | #define PROTECTED_DACL_SECURITY_INFORMATION 0x80000000
|
---|
66 |
|
---|
67 | #define ALL_SECURITY_INFORMATION (OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|\
|
---|
68 | DACL_SECURITY_INFORMATION|SACL_SECURITY_INFORMATION|\
|
---|
69 | UNPROTECTED_SACL_SECURITY_INFORMATION|\
|
---|
70 | UNPROTECTED_DACL_SECURITY_INFORMATION|\
|
---|
71 | PROTECTED_SACL_SECURITY_INFORMATION|\
|
---|
72 | PROTECTED_DACL_SECURITY_INFORMATION)
|
---|
73 |
|
---|
74 | /* SEC_ACCESS */
|
---|
75 | typedef uint32 SEC_ACCESS;
|
---|
76 |
|
---|
77 | /* SEC_ACE */
|
---|
78 | typedef struct security_ace_info {
|
---|
79 | uint8 type; /* xxxx_xxxx_ACE_TYPE - e.g allowed / denied etc */
|
---|
80 | uint8 flags; /* xxxx_INHERIT_xxxx - e.g OBJECT_INHERIT_ACE */
|
---|
81 | uint16 size;
|
---|
82 |
|
---|
83 | SEC_ACCESS access_mask;
|
---|
84 |
|
---|
85 | /* this stuff may be present when type is XXXX_TYPE_XXXX_OBJECT */
|
---|
86 | uint32 obj_flags; /* xxxx_ACE_OBJECT_xxxx e.g present/inherited present etc */
|
---|
87 | struct GUID obj_guid; /* object GUID */
|
---|
88 | struct GUID inh_guid; /* inherited object GUID */
|
---|
89 | /* eof object stuff */
|
---|
90 |
|
---|
91 | DOM_SID trustee;
|
---|
92 |
|
---|
93 | } SEC_ACE;
|
---|
94 | #define SEC_ACE_HEADER_SIZE (2 * sizeof(uint8) + sizeof(uint16) + sizeof(uint32))
|
---|
95 |
|
---|
96 | #ifndef ACL_REVISION
|
---|
97 | #define ACL_REVISION 0x3
|
---|
98 | #endif
|
---|
99 |
|
---|
100 | #ifndef _SEC_ACL
|
---|
101 | /* SEC_ACL */
|
---|
102 | typedef struct security_acl_info {
|
---|
103 | uint16 revision; /* 0x0003 */
|
---|
104 | uint16 size; /* size in bytes of the entire ACL structure */
|
---|
105 | uint32 num_aces; /* number of Access Control Entries */
|
---|
106 |
|
---|
107 | SEC_ACE *aces;
|
---|
108 |
|
---|
109 | } SEC_ACL;
|
---|
110 | #define SEC_ACL_HEADER_SIZE (2 * sizeof(uint16) + sizeof(uint32))
|
---|
111 | #define _SEC_ACL
|
---|
112 | #endif
|
---|
113 |
|
---|
114 | #ifndef SEC_DESC_REVISION
|
---|
115 | #define SEC_DESC_REVISION 0x1
|
---|
116 | #endif
|
---|
117 |
|
---|
118 | #ifndef _SEC_DESC
|
---|
119 | /* SEC_DESC */
|
---|
120 | typedef struct security_descriptor_info {
|
---|
121 | uint16 revision; /* 0x0001 */
|
---|
122 | uint16 type; /* SEC_DESC_xxxx flags */
|
---|
123 |
|
---|
124 | uint32 off_owner_sid; /* offset to owner sid */
|
---|
125 | uint32 off_grp_sid ; /* offset to group sid */
|
---|
126 | uint32 off_sacl ; /* offset to system list of permissions */
|
---|
127 | uint32 off_dacl ; /* offset to list of permissions */
|
---|
128 |
|
---|
129 | SEC_ACL *dacl; /* user ACL */
|
---|
130 | SEC_ACL *sacl; /* system ACL */
|
---|
131 | DOM_SID *owner_sid;
|
---|
132 | DOM_SID *group_sid;
|
---|
133 |
|
---|
134 | } SEC_DESC;
|
---|
135 | #define SEC_DESC_HEADER_SIZE (2 * sizeof(uint16) + 4 * sizeof(uint32))
|
---|
136 | #define _SEC_DESC
|
---|
137 | #endif
|
---|
138 |
|
---|
139 | #ifndef _SEC_DESC_BUF
|
---|
140 | /* SEC_DESC_BUF */
|
---|
141 | typedef struct sec_desc_buf_info {
|
---|
142 | uint32 max_len;
|
---|
143 | uint32 ptr;
|
---|
144 | uint32 len;
|
---|
145 |
|
---|
146 | SEC_DESC *sec;
|
---|
147 |
|
---|
148 | } SEC_DESC_BUF;
|
---|
149 | #define _SEC_DESC_BUF
|
---|
150 | #endif
|
---|
151 |
|
---|
152 | /* A type to describe the mapping of generic access rights to object
|
---|
153 | specific access rights. */
|
---|
154 |
|
---|
155 | typedef struct generic_mapping {
|
---|
156 | uint32 generic_read;
|
---|
157 | uint32 generic_write;
|
---|
158 | uint32 generic_execute;
|
---|
159 | uint32 generic_all;
|
---|
160 | } GENERIC_MAPPING;
|
---|
161 |
|
---|
162 | typedef struct standard_mapping {
|
---|
163 | uint32 std_read;
|
---|
164 | uint32 std_write;
|
---|
165 | uint32 std_execute;
|
---|
166 | uint32 std_all;
|
---|
167 | } STANDARD_MAPPING;
|
---|
168 |
|
---|
169 |
|
---|
170 | /* Security Access Masks Rights */
|
---|
171 |
|
---|
172 | #define SPECIFIC_RIGHTS_MASK 0x0000FFFF
|
---|
173 | #define STANDARD_RIGHTS_MASK 0x00FF0000
|
---|
174 | #define GENERIC_RIGHTS_MASK 0xF0000000
|
---|
175 |
|
---|
176 | #define SEC_RIGHT_SYSTEM_SECURITY 0x01000000
|
---|
177 | #define SEC_RIGHT_MAXIMUM_ALLOWED 0x02000000
|
---|
178 |
|
---|
179 | /* Generic access rights */
|
---|
180 |
|
---|
181 | #define GENERIC_RIGHT_ALL_ACCESS 0x10000000
|
---|
182 | #define GENERIC_RIGHT_EXECUTE_ACCESS 0x20000000
|
---|
183 | #define GENERIC_RIGHT_WRITE_ACCESS 0x40000000
|
---|
184 | #define GENERIC_RIGHT_READ_ACCESS 0x80000000
|
---|
185 |
|
---|
186 | /* Standard access rights. */
|
---|
187 |
|
---|
188 | #define STD_RIGHT_DELETE_ACCESS 0x00010000
|
---|
189 | #define STD_RIGHT_READ_CONTROL_ACCESS 0x00020000
|
---|
190 | #define STD_RIGHT_WRITE_DAC_ACCESS 0x00040000
|
---|
191 | #define STD_RIGHT_WRITE_OWNER_ACCESS 0x00080000
|
---|
192 | #define STD_RIGHT_SYNCHRONIZE_ACCESS 0x00100000
|
---|
193 |
|
---|
194 | #define STD_RIGHT_ALL_ACCESS 0x001F0000
|
---|
195 |
|
---|
196 | /* Combinations of standard masks. */
|
---|
197 | #define STANDARD_RIGHTS_ALL_ACCESS STD_RIGHT_ALL_ACCESS /* 0x001f0000 */
|
---|
198 | #define STANDARD_RIGHTS_MODIFY_ACCESS STD_RIGHT_READ_CONTROL_ACCESS /* 0x00020000 */
|
---|
199 | #define STANDARD_RIGHTS_EXECUTE_ACCESS STD_RIGHT_READ_CONTROL_ACCESS /* 0x00020000 */
|
---|
200 | #define STANDARD_RIGHTS_READ_ACCESS STD_RIGHT_READ_CONTROL_ACCESS /* 0x00020000 */
|
---|
201 | #define STANDARD_RIGHTS_WRITE_ACCESS \
|
---|
202 | (STD_RIGHT_WRITE_OWNER_ACCESS | \
|
---|
203 | STD_RIGHT_WRITE_DAC_ACCESS | \
|
---|
204 | STD_RIGHT_DELETE_ACCESS) /* 0x000d0000 */
|
---|
205 | #define STANDARD_RIGHTS_REQUIRED_ACCESS \
|
---|
206 | (STD_RIGHT_DELETE_ACCESS | \
|
---|
207 | STD_RIGHT_READ_CONTROL_ACCESS | \
|
---|
208 | STD_RIGHT_WRITE_DAC_ACCESS | \
|
---|
209 | STD_RIGHT_WRITE_OWNER_ACCESS) /* 0x000f0000 */
|
---|
210 |
|
---|
211 | /* File Object specific access rights */
|
---|
212 |
|
---|
213 | #define SA_RIGHT_FILE_READ_DATA 0x00000001
|
---|
214 | #define SA_RIGHT_FILE_WRITE_DATA 0x00000002
|
---|
215 | #define SA_RIGHT_FILE_APPEND_DATA 0x00000004
|
---|
216 | #define SA_RIGHT_FILE_READ_EA 0x00000008
|
---|
217 | #define SA_RIGHT_FILE_WRITE_EA 0x00000010
|
---|
218 | #define SA_RIGHT_FILE_EXECUTE 0x00000020
|
---|
219 | #define SA_RIGHT_FILE_DELETE_CHILD 0x00000040
|
---|
220 | #define SA_RIGHT_FILE_READ_ATTRIBUTES 0x00000080
|
---|
221 | #define SA_RIGHT_FILE_WRITE_ATTRIBUTES 0x00000100
|
---|
222 |
|
---|
223 | #define SA_RIGHT_FILE_ALL_ACCESS 0x000001FF
|
---|
224 |
|
---|
225 | #define GENERIC_RIGHTS_FILE_ALL_ACCESS \
|
---|
226 | (STANDARD_RIGHTS_REQUIRED_ACCESS| \
|
---|
227 | STD_RIGHT_SYNCHRONIZE_ACCESS | \
|
---|
228 | SA_RIGHT_FILE_ALL_ACCESS)
|
---|
229 |
|
---|
230 | #define GENERIC_RIGHTS_FILE_READ \
|
---|
231 | (STANDARD_RIGHTS_READ_ACCESS | \
|
---|
232 | STD_RIGHT_SYNCHRONIZE_ACCESS | \
|
---|
233 | SA_RIGHT_FILE_READ_DATA | \
|
---|
234 | SA_RIGHT_FILE_READ_ATTRIBUTES | \
|
---|
235 | SA_RIGHT_FILE_READ_EA)
|
---|
236 |
|
---|
237 | #define GENERIC_RIGHTS_FILE_WRITE \
|
---|
238 | (STANDARD_RIGHTS_WRITE_ACCESS | \
|
---|
239 | STD_RIGHT_SYNCHRONIZE_ACCESS | \
|
---|
240 | SA_RIGHT_FILE_WRITE_DATA | \
|
---|
241 | SA_RIGHT_FILE_WRITE_ATTRIBUTES | \
|
---|
242 | SA_RIGHT_FILE_WRITE_EA | \
|
---|
243 | SA_RIGHT_FILE_APPEND_DATA)
|
---|
244 |
|
---|
245 | #define GENERIC_RIGHTS_FILE_EXECUTE \
|
---|
246 | (STANDARD_RIGHTS_EXECUTE_ACCESS | \
|
---|
247 | STD_RIGHT_SYNCHRONIZE_ACCESS | \
|
---|
248 | SA_RIGHT_FILE_READ_ATTRIBUTES | \
|
---|
249 | SA_RIGHT_FILE_EXECUTE)
|
---|
250 |
|
---|
251 | #define GENERIC_RIGHTS_FILE_MODIFY \
|
---|
252 | (STANDARD_RIGHTS_MODIFY_ACCESS | \
|
---|
253 | STD_RIGHT_SYNCHRONIZE_ACCESS | \
|
---|
254 | STD_RIGHT_DELETE_ACCESS | \
|
---|
255 | SA_RIGHT_FILE_WRITE_ATTRIBUTES | \
|
---|
256 | SA_RIGHT_FILE_READ_ATTRIBUTES | \
|
---|
257 | SA_RIGHT_FILE_EXECUTE | \
|
---|
258 | SA_RIGHT_FILE_WRITE_EA | \
|
---|
259 | SA_RIGHT_FILE_READ_EA | \
|
---|
260 | SA_RIGHT_FILE_APPEND_DATA | \
|
---|
261 | SA_RIGHT_FILE_WRITE_DATA | \
|
---|
262 | SA_RIGHT_FILE_READ_DATA)
|
---|
263 |
|
---|
264 | /* SAM server specific access rights */
|
---|
265 |
|
---|
266 | #define SA_RIGHT_SAM_CONNECT_SERVER 0x00000001
|
---|
267 | #define SA_RIGHT_SAM_SHUTDOWN_SERVER 0x00000002
|
---|
268 | #define SA_RIGHT_SAM_INITIALISE_SERVER 0x00000004
|
---|
269 | #define SA_RIGHT_SAM_CREATE_DOMAIN 0x00000008
|
---|
270 | #define SA_RIGHT_SAM_ENUM_DOMAINS 0x00000010
|
---|
271 | #define SA_RIGHT_SAM_OPEN_DOMAIN 0x00000020
|
---|
272 |
|
---|
273 | #define SA_RIGHT_SAM_ALL_ACCESS 0x0000003F
|
---|
274 |
|
---|
275 | #define GENERIC_RIGHTS_SAM_ALL_ACCESS \
|
---|
276 | (STANDARD_RIGHTS_REQUIRED_ACCESS| \
|
---|
277 | SA_RIGHT_SAM_ALL_ACCESS)
|
---|
278 |
|
---|
279 | #define GENERIC_RIGHTS_SAM_READ \
|
---|
280 | (STANDARD_RIGHTS_READ_ACCESS | \
|
---|
281 | SA_RIGHT_SAM_ENUM_DOMAINS)
|
---|
282 |
|
---|
283 | #define GENERIC_RIGHTS_SAM_WRITE \
|
---|
284 | (STANDARD_RIGHTS_WRITE_ACCESS | \
|
---|
285 | SA_RIGHT_SAM_CREATE_DOMAIN | \
|
---|
286 | SA_RIGHT_SAM_INITIALISE_SERVER | \
|
---|
287 | SA_RIGHT_SAM_SHUTDOWN_SERVER)
|
---|
288 |
|
---|
289 | #define GENERIC_RIGHTS_SAM_EXECUTE \
|
---|
290 | (STANDARD_RIGHTS_EXECUTE_ACCESS | \
|
---|
291 | SA_RIGHT_SAM_OPEN_DOMAIN | \
|
---|
292 | SA_RIGHT_SAM_CONNECT_SERVER)
|
---|
293 |
|
---|
294 |
|
---|
295 | /* Domain Object specific access rights */
|
---|
296 |
|
---|
297 | #define SA_RIGHT_DOMAIN_LOOKUP_INFO_1 0x00000001
|
---|
298 | #define SA_RIGHT_DOMAIN_SET_INFO_1 0x00000002
|
---|
299 | #define SA_RIGHT_DOMAIN_LOOKUP_INFO_2 0x00000004
|
---|
300 | #define SA_RIGHT_DOMAIN_SET_INFO_2 0x00000008
|
---|
301 | #define SA_RIGHT_DOMAIN_CREATE_USER 0x00000010
|
---|
302 | #define SA_RIGHT_DOMAIN_CREATE_GROUP 0x00000020
|
---|
303 | #define SA_RIGHT_DOMAIN_CREATE_ALIAS 0x00000040
|
---|
304 | #define SA_RIGHT_DOMAIN_LOOKUP_ALIAS_BY_MEM 0x00000080
|
---|
305 | #define SA_RIGHT_DOMAIN_ENUM_ACCOUNTS 0x00000100
|
---|
306 | #define SA_RIGHT_DOMAIN_OPEN_ACCOUNT 0x00000200
|
---|
307 | #define SA_RIGHT_DOMAIN_SET_INFO_3 0x00000400
|
---|
308 |
|
---|
309 | #define SA_RIGHT_DOMAIN_ALL_ACCESS 0x000007FF
|
---|
310 |
|
---|
311 | #define GENERIC_RIGHTS_DOMAIN_ALL_ACCESS \
|
---|
312 | (STANDARD_RIGHTS_REQUIRED_ACCESS| \
|
---|
313 | SA_RIGHT_DOMAIN_ALL_ACCESS)
|
---|
314 |
|
---|
315 | #define GENERIC_RIGHTS_DOMAIN_READ \
|
---|
316 | (STANDARD_RIGHTS_READ_ACCESS | \
|
---|
317 | SA_RIGHT_DOMAIN_LOOKUP_ALIAS_BY_MEM | \
|
---|
318 | SA_RIGHT_DOMAIN_LOOKUP_INFO_2)
|
---|
319 |
|
---|
320 | #define GENERIC_RIGHTS_DOMAIN_WRITE \
|
---|
321 | (STANDARD_RIGHTS_WRITE_ACCESS | \
|
---|
322 | SA_RIGHT_DOMAIN_SET_INFO_3 | \
|
---|
323 | SA_RIGHT_DOMAIN_CREATE_ALIAS | \
|
---|
324 | SA_RIGHT_DOMAIN_CREATE_GROUP | \
|
---|
325 | SA_RIGHT_DOMAIN_CREATE_USER | \
|
---|
326 | SA_RIGHT_DOMAIN_SET_INFO_2 | \
|
---|
327 | SA_RIGHT_DOMAIN_SET_INFO_1)
|
---|
328 |
|
---|
329 | #define GENERIC_RIGHTS_DOMAIN_EXECUTE \
|
---|
330 | (STANDARD_RIGHTS_EXECUTE_ACCESS | \
|
---|
331 | SA_RIGHT_DOMAIN_OPEN_ACCOUNT | \
|
---|
332 | SA_RIGHT_DOMAIN_ENUM_ACCOUNTS | \
|
---|
333 | SA_RIGHT_DOMAIN_LOOKUP_INFO_1)
|
---|
334 |
|
---|
335 |
|
---|
336 | /* User Object specific access rights */
|
---|
337 |
|
---|
338 | #define SA_RIGHT_USER_GET_NAME_ETC 0x00000001
|
---|
339 | #define SA_RIGHT_USER_GET_LOCALE 0x00000002
|
---|
340 | #define SA_RIGHT_USER_SET_LOC_COM 0x00000004
|
---|
341 | #define SA_RIGHT_USER_GET_LOGONINFO 0x00000008
|
---|
342 | #define SA_RIGHT_USER_ACCT_FLAGS_EXPIRY 0x00000010
|
---|
343 | #define SA_RIGHT_USER_SET_ATTRIBUTES 0x00000020
|
---|
344 | #define SA_RIGHT_USER_CHANGE_PASSWORD 0x00000040
|
---|
345 | #define SA_RIGHT_USER_SET_PASSWORD 0x00000080
|
---|
346 | #define SA_RIGHT_USER_GET_GROUPS 0x00000100
|
---|
347 | #define SA_RIGHT_USER_READ_GROUP_MEM 0x00000200
|
---|
348 | #define SA_RIGHT_USER_CHANGE_GROUP_MEM 0x00000400
|
---|
349 |
|
---|
350 | #define SA_RIGHT_USER_ALL_ACCESS 0x000007FF
|
---|
351 |
|
---|
352 | #define GENERIC_RIGHTS_USER_ALL_ACCESS \
|
---|
353 | (STANDARD_RIGHTS_REQUIRED_ACCESS| \
|
---|
354 | SA_RIGHT_USER_ALL_ACCESS) /* 0x000f07ff */
|
---|
355 |
|
---|
356 | #define GENERIC_RIGHTS_USER_READ \
|
---|
357 | (STANDARD_RIGHTS_READ_ACCESS | \
|
---|
358 | SA_RIGHT_USER_READ_GROUP_MEM | \
|
---|
359 | SA_RIGHT_USER_GET_GROUPS | \
|
---|
360 | SA_RIGHT_USER_ACCT_FLAGS_EXPIRY | \
|
---|
361 | SA_RIGHT_USER_GET_LOGONINFO | \
|
---|
362 | SA_RIGHT_USER_GET_LOCALE) /* 0x0002031a */
|
---|
363 |
|
---|
364 | #define GENERIC_RIGHTS_USER_WRITE \
|
---|
365 | (STANDARD_RIGHTS_WRITE_ACCESS | \
|
---|
366 | SA_RIGHT_USER_CHANGE_PASSWORD | \
|
---|
367 | SA_RIGHT_USER_SET_LOC_COM | \
|
---|
368 | SA_RIGHT_USER_SET_ATTRIBUTES | \
|
---|
369 | SA_RIGHT_USER_SET_PASSWORD | \
|
---|
370 | SA_RIGHT_USER_CHANGE_GROUP_MEM) /* 0x000204e4 */
|
---|
371 |
|
---|
372 | #define GENERIC_RIGHTS_USER_EXECUTE \
|
---|
373 | (STANDARD_RIGHTS_EXECUTE_ACCESS | \
|
---|
374 | SA_RIGHT_USER_CHANGE_PASSWORD | \
|
---|
375 | SA_RIGHT_USER_GET_NAME_ETC ) /* 0x00020041 */
|
---|
376 |
|
---|
377 |
|
---|
378 | /* Group Object specific access rights */
|
---|
379 |
|
---|
380 | #define SA_RIGHT_GROUP_LOOKUP_INFO 0x00000001
|
---|
381 | #define SA_RIGHT_GROUP_SET_INFO 0x00000002
|
---|
382 | #define SA_RIGHT_GROUP_ADD_MEMBER 0x00000004
|
---|
383 | #define SA_RIGHT_GROUP_REMOVE_MEMBER 0x00000008
|
---|
384 | #define SA_RIGHT_GROUP_GET_MEMBERS 0x00000010
|
---|
385 |
|
---|
386 | #define SA_RIGHT_GROUP_ALL_ACCESS 0x0000001F
|
---|
387 |
|
---|
388 | #define GENERIC_RIGHTS_GROUP_ALL_ACCESS \
|
---|
389 | (STANDARD_RIGHTS_REQUIRED_ACCESS| \
|
---|
390 | SA_RIGHT_GROUP_ALL_ACCESS) /* 0x000f001f */
|
---|
391 |
|
---|
392 | #define GENERIC_RIGHTS_GROUP_READ \
|
---|
393 | (STANDARD_RIGHTS_READ_ACCESS | \
|
---|
394 | SA_RIGHT_GROUP_GET_MEMBERS) /* 0x00020010 */
|
---|
395 |
|
---|
396 | #define GENERIC_RIGHTS_GROUP_WRITE \
|
---|
397 | (STANDARD_RIGHTS_WRITE_ACCESS | \
|
---|
398 | SA_RIGHT_GROUP_REMOVE_MEMBER | \
|
---|
399 | SA_RIGHT_GROUP_ADD_MEMBER | \
|
---|
400 | SA_RIGHT_GROUP_SET_INFO ) /* 0x0002000e */
|
---|
401 |
|
---|
402 | #define GENERIC_RIGHTS_GROUP_EXECUTE \
|
---|
403 | (STANDARD_RIGHTS_EXECUTE_ACCESS | \
|
---|
404 | SA_RIGHT_GROUP_LOOKUP_INFO) /* 0x00020001 */
|
---|
405 |
|
---|
406 |
|
---|
407 | /* Alias Object specific access rights */
|
---|
408 |
|
---|
409 | #define SA_RIGHT_ALIAS_ADD_MEMBER 0x00000001
|
---|
410 | #define SA_RIGHT_ALIAS_REMOVE_MEMBER 0x00000002
|
---|
411 | #define SA_RIGHT_ALIAS_GET_MEMBERS 0x00000004
|
---|
412 | #define SA_RIGHT_ALIAS_LOOKUP_INFO 0x00000008
|
---|
413 | #define SA_RIGHT_ALIAS_SET_INFO 0x00000010
|
---|
414 |
|
---|
415 | #define SA_RIGHT_ALIAS_ALL_ACCESS 0x0000001F
|
---|
416 |
|
---|
417 | #define GENERIC_RIGHTS_ALIAS_ALL_ACCESS \
|
---|
418 | (STANDARD_RIGHTS_REQUIRED_ACCESS| \
|
---|
419 | SA_RIGHT_ALIAS_ALL_ACCESS) /* 0x000f001f */
|
---|
420 |
|
---|
421 | #define GENERIC_RIGHTS_ALIAS_READ \
|
---|
422 | (STANDARD_RIGHTS_READ_ACCESS | \
|
---|
423 | SA_RIGHT_ALIAS_GET_MEMBERS ) /* 0x00020004 */
|
---|
424 |
|
---|
425 | #define GENERIC_RIGHTS_ALIAS_WRITE \
|
---|
426 | (STANDARD_RIGHTS_WRITE_ACCESS | \
|
---|
427 | SA_RIGHT_ALIAS_REMOVE_MEMBER | \
|
---|
428 | SA_RIGHT_ALIAS_ADD_MEMBER | \
|
---|
429 | SA_RIGHT_ALIAS_SET_INFO ) /* 0x00020013 */
|
---|
430 |
|
---|
431 | #define GENERIC_RIGHTS_ALIAS_EXECUTE \
|
---|
432 | (STANDARD_RIGHTS_EXECUTE_ACCESS | \
|
---|
433 | SA_RIGHT_ALIAS_LOOKUP_INFO ) /* 0x00020008 */
|
---|
434 |
|
---|
435 | /*
|
---|
436 | * Acces bits for the svcctl objects
|
---|
437 | */
|
---|
438 |
|
---|
439 | /* Service Control Manager Bits */
|
---|
440 |
|
---|
441 | #define SC_RIGHT_MGR_CONNECT 0x0001
|
---|
442 | #define SC_RIGHT_MGR_CREATE_SERVICE 0x0002
|
---|
443 | #define SC_RIGHT_MGR_ENUMERATE_SERVICE 0x0004
|
---|
444 | #define SC_RIGHT_MGR_LOCK 0x0008
|
---|
445 | #define SC_RIGHT_MGR_QUERY_LOCK_STATUS 0x0010
|
---|
446 | #define SC_RIGHT_MGR_MODIFY_BOOT_CONFIG 0x0020
|
---|
447 |
|
---|
448 | #define SC_MANAGER_READ_ACCESS \
|
---|
449 | ( STANDARD_RIGHTS_READ_ACCESS | \
|
---|
450 | SC_RIGHT_MGR_CONNECT | \
|
---|
451 | SC_RIGHT_MGR_ENUMERATE_SERVICE | \
|
---|
452 | SC_RIGHT_MGR_QUERY_LOCK_STATUS )
|
---|
453 |
|
---|
454 | #define SC_MANAGER_EXECUTE_ACCESS SC_MANAGER_READ_ACCESS
|
---|
455 |
|
---|
456 | #define SC_MANAGER_WRITE_ACCESS \
|
---|
457 | ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
|
---|
458 | SC_MANAGER_READ_ACCESS | \
|
---|
459 | SC_RIGHT_MGR_CREATE_SERVICE | \
|
---|
460 | SC_RIGHT_MGR_LOCK | \
|
---|
461 | SC_RIGHT_MGR_MODIFY_BOOT_CONFIG )
|
---|
462 |
|
---|
463 | #define SC_MANAGER_ALL_ACCESS SC_MANAGER_WRITE_ACCESS
|
---|
464 |
|
---|
465 | /* Service Object Bits */
|
---|
466 |
|
---|
467 | #define SC_RIGHT_SVC_QUERY_CONFIG 0x0001
|
---|
468 | #define SC_RIGHT_SVC_CHANGE_CONFIG 0x0002
|
---|
469 | #define SC_RIGHT_SVC_QUERY_STATUS 0x0004
|
---|
470 | #define SC_RIGHT_SVC_ENUMERATE_DEPENDENTS 0x0008
|
---|
471 | #define SC_RIGHT_SVC_START 0x0010
|
---|
472 | #define SC_RIGHT_SVC_STOP 0x0020
|
---|
473 | #define SC_RIGHT_SVC_PAUSE_CONTINUE 0x0040
|
---|
474 | #define SC_RIGHT_SVC_INTERROGATE 0x0080
|
---|
475 | #define SC_RIGHT_SVC_USER_DEFINED_CONTROL 0x0100
|
---|
476 |
|
---|
477 | #define SERVICE_READ_ACCESS \
|
---|
478 | ( STANDARD_RIGHTS_READ_ACCESS | \
|
---|
479 | SC_RIGHT_SVC_ENUMERATE_DEPENDENTS | \
|
---|
480 | SC_RIGHT_SVC_INTERROGATE | \
|
---|
481 | SC_RIGHT_SVC_QUERY_CONFIG | \
|
---|
482 | SC_RIGHT_SVC_QUERY_STATUS | \
|
---|
483 | SC_RIGHT_SVC_USER_DEFINED_CONTROL )
|
---|
484 |
|
---|
485 | #define SERVICE_EXECUTE_ACCESS \
|
---|
486 | ( SERVICE_READ_ACCESS | \
|
---|
487 | SC_RIGHT_SVC_START | \
|
---|
488 | SC_RIGHT_SVC_STOP | \
|
---|
489 | SC_RIGHT_SVC_PAUSE_CONTINUE )
|
---|
490 |
|
---|
491 | #define SERVICE_WRITE_ACCESS \
|
---|
492 | ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
|
---|
493 | SERVICE_READ_ACCESS | \
|
---|
494 | SERVICE_EXECUTE_ACCESS | \
|
---|
495 | SC_RIGHT_SVC_CHANGE_CONFIG )
|
---|
496 |
|
---|
497 | #define SERVICE_ALL_ACCESS SERVICE_WRITE_ACCESS
|
---|
498 |
|
---|
499 |
|
---|
500 |
|
---|
501 | /*
|
---|
502 | * Access Bits for registry ACLS
|
---|
503 | */
|
---|
504 |
|
---|
505 | /* used by registry ACLs */
|
---|
506 |
|
---|
507 | #define SEC_RIGHTS_QUERY_VALUE 0x00000001
|
---|
508 | #define SEC_RIGHTS_SET_VALUE 0x00000002
|
---|
509 | #define SEC_RIGHTS_CREATE_SUBKEY 0x00000004
|
---|
510 | #define SEC_RIGHTS_ENUM_SUBKEYS 0x00000008
|
---|
511 | #define SEC_RIGHTS_NOTIFY 0x00000010
|
---|
512 | #define SEC_RIGHTS_CREATE_LINK 0x00000020
|
---|
513 | #define SEC_RIGHTS_MAXIMUM_ALLOWED 0x02000000
|
---|
514 |
|
---|
515 |
|
---|
516 | #define REG_KEY_READ \
|
---|
517 | ( STANDARD_RIGHTS_READ_ACCESS |\
|
---|
518 | SEC_RIGHTS_QUERY_VALUE |\
|
---|
519 | SEC_RIGHTS_ENUM_SUBKEYS |\
|
---|
520 | SEC_RIGHTS_NOTIFY )
|
---|
521 |
|
---|
522 | #define REG_KEY_EXECUTE REG_KEY_READ
|
---|
523 |
|
---|
524 | #define REG_KEY_WRITE \
|
---|
525 | ( STANDARD_RIGHTS_WRITE_ACCESS |\
|
---|
526 | SEC_RIGHTS_SET_VALUE |\
|
---|
527 | SEC_RIGHTS_CREATE_SUBKEY )
|
---|
528 |
|
---|
529 | #define REG_KEY_ALL \
|
---|
530 | ( STANDARD_RIGHTS_REQUIRED_ACCESS |\
|
---|
531 | REG_KEY_READ |\
|
---|
532 | REG_KEY_WRITE |\
|
---|
533 | SEC_RIGHTS_CREATE_LINK )
|
---|
534 |
|
---|
535 |
|
---|
536 | #endif /* _RPC_SECDES_H */
|
---|