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
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.
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.
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.
22 #ifndef _RPC_SECDES_H /* _RPC_SECDES_H */
25 #define SEC_RIGHTS_QUERY_VALUE 0x00000001
26 #define SEC_RIGHTS_SET_VALUE 0x00000002
27 #define SEC_RIGHTS_CREATE_SUBKEY 0x00000004
28 #define SEC_RIGHTS_ENUM_SUBKEYS 0x00000008
29 #define SEC_RIGHTS_NOTIFY 0x00000010
30 #define SEC_RIGHTS_CREATE_LINK 0x00000020
31 #define SEC_RIGHTS_READ 0x00020019
32 #define SEC_RIGHTS_FULL_CONTROL 0x000f003f
33 #define SEC_RIGHTS_MAXIMUM_ALLOWED 0x02000000
35 #define SEC_RIGHTS_LIST_CONTENTS 0x4
36 #define SEC_RIGHTS_LIST_OBJECT 0x80
37 #define SEC_RIGHTS_READ_ALL_PROP 0x10
38 #define SEC_RIGHTS_READ_PERMS 0x20000
39 #define SEC_RIGHTS_WRITE_ALL_VALID 0x8
40 #define SEC_RIGHTS_WRITE_ALL_PROP 0x20
41 #define SEC_RIGHTS_MODIFY_OWNER 0x80000
42 #define SEC_RIGHTS_MODIFY_PERMS 0x40000
43 #define SEC_RIGHTS_CREATE_CHILD 0x1
44 #define SEC_RIGHTS_DELETE_CHILD 0x2
45 #define SEC_RIGHTS_DELETE_SUBTREE 0x40
46 #define SEC_RIGHTS_DELETE 0x10000 /* advanced/special/object/delete */
47 #define SEC_RIGHTS_EXTENDED 0x100 /* change/reset password, receive/send as*/
48 #define SEC_RIGHTS_CHANGE_PASSWD SEC_RIGHTS_EXTENDED
49 #define SEC_RIGHTS_RESET_PASSWD SEC_RIGHTS_EXTENDED
50 #define SEC_RIGHTS_FULL_CTRL 0xf01ff
52 #define SEC_ACE_OBJECT_PRESENT 0x00000001 /* thanks for Jim McDonough <jmcd@us.ibm.com> */
53 #define SEC_ACE_OBJECT_INHERITED_PRESENT 0x00000002
55 #define SEC_ACE_FLAG_OBJECT_INHERIT 0x1
56 #define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2
57 #define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4
58 #define SEC_ACE_FLAG_INHERIT_ONLY 0x8
59 #define SEC_ACE_FLAG_INHERITED_ACE 0x10 /* New for Windows 2000 */
60 #define SEC_ACE_FLAG_VALID_INHERIT 0xf
61 #define SEC_ACE_FLAG_SUCCESSFUL_ACCESS 0x40
62 #define SEC_ACE_FLAG_FAILED_ACCESS 0x80
64 #define SEC_ACE_TYPE_ACCESS_ALLOWED 0x0
65 #define SEC_ACE_TYPE_ACCESS_DENIED 0x1
66 #define SEC_ACE_TYPE_SYSTEM_AUDIT 0x2
67 #define SEC_ACE_TYPE_SYSTEM_ALARM 0x3
68 #define SEC_ACE_TYPE_ALLOWED_COMPOUND 0x4
69 #define SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT 0x5
70 #define SEC_ACE_TYPE_ACCESS_DENIED_OBJECT 0x6
71 #define SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT 0x7
72 #define SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT 0x8
74 #define SEC_DESC_OWNER_DEFAULTED 0x0001
75 #define SEC_DESC_GROUP_DEFAULTED 0x0002
76 #define SEC_DESC_DACL_PRESENT 0x0004
77 #define SEC_DESC_DACL_DEFAULTED 0x0008
78 #define SEC_DESC_SACL_PRESENT 0x0010
79 #define SEC_DESC_SACL_DEFAULTED 0x0020
80 #define SEC_DESC_SELF_RELATIVE 0x8000
82 * New Windows 2000 bits.
84 #define SE_DESC_DACL_AUTO_INHERIT_REQ 0x0100
85 #define SE_DESC_SACL_AUTO_INHERIT_REQ 0x0200
86 #define SE_DESC_DACL_AUTO_INHERITED 0x0400
87 #define SE_DESC_SACL_AUTO_INHERITED 0x0800
88 #define SE_DESC_DACL_PROTECTED 0x1000
89 #define SE_DESC_SACL_PROTECTED 0x2000
91 /* security information */
92 #define OWNER_SECURITY_INFORMATION 0x00000001
93 #define GROUP_SECURITY_INFORMATION 0x00000002
94 #define DACL_SECURITY_INFORMATION 0x00000004
95 #define SACL_SECURITY_INFORMATION 0x00000008
97 #define ALL_SECURITY_INFORMATION (OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|\
98 DACL_SECURITY_INFORMATION|SACL_SECURITY_INFORMATION)
100 /* Globally Unique ID */
102 typedef struct guid_info
104 uint8 info
[GUID_SIZE
];
108 typedef struct security_info_info
115 typedef struct security_ace_info
117 uint8 type
; /* xxxx_xxxx_ACE_TYPE - e.g allowed / denied etc */
118 uint8 flags
; /* xxxx_INHERIT_xxxx - e.g OBJECT_INHERIT_ACE */
123 /* this stuff may be present when type is XXXX_TYPE_XXXX_OBJECT */
124 uint32 obj_flags
; /* xxxx_ACE_OBJECT_xxxx e.g present/inherited present etc */
125 GUID obj_guid
; /* object GUID */
126 GUID inh_guid
; /* inherited object GUID */
127 /* eof object stuff */
132 #define SEC_ACE_HEADER_SIZE (2 * sizeof(uint8) + sizeof(uint16) + sizeof(uint32))
135 #define ACL_REVISION 0x3
138 #ifndef NT4_ACL_REVISION
139 #define NT4_ACL_REVISION 0x2
144 typedef struct security_acl_info
146 uint16 revision
; /* 0x0003 */
147 uint16 size
; /* size in bytes of the entire ACL structure */
148 uint32 num_aces
; /* number of Access Control Entries */
153 #define SEC_ACL_HEADER_SIZE (2 * sizeof(uint16) + sizeof(uint32))
157 #ifndef SEC_DESC_REVISION
158 #define SEC_DESC_REVISION 0x1
163 typedef struct security_descriptor_info
165 uint16 revision
; /* 0x0001 */
166 uint16 type
; /* SEC_DESC_xxxx flags */
168 uint32 off_owner_sid
; /* offset to owner sid */
169 uint32 off_grp_sid
; /* offset to group sid */
170 uint32 off_sacl
; /* offset to system list of permissions */
171 uint32 off_dacl
; /* offset to list of permissions */
173 SEC_ACL
*dacl
; /* user ACL */
174 SEC_ACL
*sacl
; /* system ACL */
179 #define SEC_DESC_HEADER_SIZE (2 * sizeof(uint16) + 4 * sizeof(uint32))
183 #ifndef _SEC_DESC_BUF
185 typedef struct sec_desc_buf_info
194 #define _SEC_DESC_BUF
197 /* A type to describe the mapping of generic access rights to object
198 specific access rights. */
200 typedef struct generic_mapping
{
202 uint32 generic_write
;
203 uint32 generic_execute
;
207 typedef struct standard_mapping
{
214 #endif /* _RPC_SECDES_H */