preparing for release of 2.2.3a
[Samba.git] / source / include / rpc_secdes.h
blob259c156767571951927c3fb67d9df1cfb94137c5
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 SMB parameters and setup
5 Copyright (C) Andrew Tridgell 1992-2000
6 Copyright (C) Luke Kenneth Casson Leighton 1996-2000
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef _RPC_SECDES_H /* _RPC_SECDES_H */
24 #define _RPC_SECDES_H
26 #define SEC_RIGHTS_QUERY_VALUE 0x00000001
27 #define SEC_RIGHTS_SET_VALUE 0x00000002
28 #define SEC_RIGHTS_CREATE_SUBKEY 0x00000004
29 #define SEC_RIGHTS_ENUM_SUBKEYS 0x00000008
30 #define SEC_RIGHTS_NOTIFY 0x00000010
31 #define SEC_RIGHTS_CREATE_LINK 0x00000020
33 #define SEC_RIGHTS_READ 0x00020019
34 #define SEC_RIGHTS_FULL_CONTROL 0x000f003f
35 #define SEC_RIGHTS_MAXIMUM_ALLOWED 0x02000000
37 #define SEC_ACE_TYPE_ACCESS_ALLOWED 0x0
38 #define SEC_ACE_TYPE_ACCESS_DENIED 0x1
39 #define SEC_ACE_TYPE_SYSTEM_AUDIT 0x2
40 #define SEC_ACE_TYPE_SYSTEM_ALARM 0x3
42 #define SEC_ACE_FLAG_OBJECT_INHERIT 0x1
43 #define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2
44 #define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4
45 #define SEC_ACE_FLAG_INHERIT_ONLY 0x8
46 #define SEC_ACE_FLAG_INHERITED_ACE 0x10 /* New for Windows 2000 */
47 #define SEC_ACE_FLAG_VALID_INHERIT 0xf
48 #define SEC_ACE_FLAG_SUCCESSFUL_ACCESS 0x40
49 #define SEC_ACE_FLAG_FAILED_ACCESS 0x80
51 #define SEC_DESC_OWNER_DEFAULTED 0x0001
52 #define SEC_DESC_GROUP_DEFAULTED 0x0002
53 #define SEC_DESC_DACL_PRESENT 0x0004
54 #define SEC_DESC_DACL_DEFAULTED 0x0008
55 #define SEC_DESC_SACL_PRESENT 0x0010
56 #define SEC_DESC_SACL_DEFAULTED 0x0020
58 * New Windows 2000 bits.
60 #define SE_DESC_DACL_AUTO_INHERIT_REQ 0x0100
61 #define SE_DESC_SACL_AUTO_INHERIT_REQ 0x0200
62 #define SE_DESC_DACL_AUTO_INHERITED 0x0400
63 #define SE_DESC_SACL_AUTO_INHERITED 0x0800
64 #define SE_DESC_DACL_PROTECTED 0x1000
65 #define SE_DESC_SACL_PROTECTED 0x2000
67 #define SEC_DESC_SELF_RELATIVE 0x8000
69 /* security information */
71 #define OWNER_SECURITY_INFORMATION 0x00000001
72 #define GROUP_SECURITY_INFORMATION 0x00000002
73 #define DACL_SECURITY_INFORMATION 0x00000004
74 #define SACL_SECURITY_INFORMATION 0x00000008
76 #define ALL_SECURITY_INFORMATION (OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|\
77 DACL_SECURITY_INFORMATION|SACL_SECURITY_INFORMATION)
79 #ifndef _SEC_ACCESS
80 /* SEC_ACCESS */
81 typedef struct security_info_info
83 uint32 mask;
85 } SEC_ACCESS;
86 #define _SEC_ACCESS
87 #endif
89 #ifndef _SEC_ACE
90 /* SEC_ACE */
91 typedef struct security_ace_info
93 uint8 type; /* xxxx_xxxx_ACE_TYPE - e.g allowed / denied etc */
94 uint8 flags; /* xxxx_INHERIT_xxxx - e.g OBJECT_INHERIT_ACE */
95 uint16 size;
97 SEC_ACCESS info;
98 DOM_SID trustee;
100 } SEC_ACE;
101 #define _SEC_ACE
102 #endif
104 #ifndef ACL_REVISION
105 #define ACL_REVISION 0x3
106 #endif
108 #ifndef NT4_ACL_REVISION
109 #define NT4_ACL_REVISION 0x2
110 #endif
112 #ifndef _SEC_ACL
113 /* SEC_ACL */
114 typedef struct security_acl_info
116 uint16 revision; /* 0x0003 */
117 uint16 size; /* size in bytes of the entire ACL structure */
118 uint32 num_aces; /* number of Access Control Entries */
120 SEC_ACE *ace;
122 } SEC_ACL;
123 #define _SEC_ACL
124 #endif
126 #ifndef SEC_DESC_REVISION
127 #define SEC_DESC_REVISION 0x1
128 #endif
130 #ifndef _SEC_DESC
131 /* SEC_DESC */
132 typedef struct security_descriptor_info
134 uint16 revision; /* 0x0001 */
135 uint16 type; /* SEC_DESC_xxxx flags */
137 uint32 off_owner_sid; /* offset to owner sid */
138 uint32 off_grp_sid ; /* offset to group sid */
139 uint32 off_sacl ; /* offset to system list of permissions */
140 uint32 off_dacl ; /* offset to list of permissions */
142 SEC_ACL *dacl; /* user ACL */
143 SEC_ACL *sacl; /* system ACL */
144 DOM_SID *owner_sid;
145 DOM_SID *grp_sid;
147 } SEC_DESC;
148 #define _SEC_DESC
149 #endif
151 #ifndef _SEC_DESC_BUF
152 /* SEC_DESC_BUF */
153 typedef struct sec_desc_buf_info
155 uint32 max_len;
156 uint32 ptr;
157 uint32 len;
159 SEC_DESC *sec;
161 } SEC_DESC_BUF;
162 #define _SEC_DESC_BUF
163 #endif
165 /* A type to describe the mapping of generic access rights to object
166 specific access rights. */
168 typedef struct generic_mapping {
169 uint32 generic_read;
170 uint32 generic_write;
171 uint32 generic_execute;
172 uint32 generic_all;
173 } GENERIC_MAPPING;
175 #endif /* _RPC_SECDES_H */