removing #include <compat.h> in hopes to avoid problems with apache header files...
[Samba/gebeck_regimport.git] / source3 / include / smb_acls.h
blob2bde6caeda1539918227ace5179016f7e8be7a9d
1 /*
2 Unix SMB/CIFS implementation.
3 Portable SMB ACL interface
4 Copyright (C) Jeremy Allison 2000
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef _SMB_ACLS_H
22 #define _SMB_ACLS_H
23 #if defined(HAVE_POSIX_ACLS)
25 /* This is an identity mapping (just remove the SMB_). */
27 #define SMB_ACL_TAG_T acl_tag_t
28 #define SMB_ACL_TYPE_T acl_type_t
29 #define SMB_ACL_PERMSET_T acl_permset_t
30 #define SMB_ACL_PERM_T acl_perm_t
31 #define SMB_ACL_READ ACL_READ
32 #define SMB_ACL_WRITE ACL_WRITE
33 #define SMB_ACL_EXECUTE ACL_EXECUTE
35 /* Types of ACLs. */
36 #define SMB_ACL_USER ACL_USER
37 #define SMB_ACL_USER_OBJ ACL_USER_OBJ
38 #define SMB_ACL_GROUP ACL_GROUP
39 #define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ
40 #define SMB_ACL_OTHER ACL_OTHER
41 #define SMB_ACL_MASK ACL_MASK
43 #define SMB_ACL_T acl_t
45 #define SMB_ACL_ENTRY_T acl_entry_t
47 #define SMB_ACL_FIRST_ENTRY ACL_FIRST_ENTRY
48 #define SMB_ACL_NEXT_ENTRY ACL_NEXT_ENTRY
50 #define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
51 #define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
53 #elif defined(HAVE_TRU64_ACLS)
55 /* This is for DEC/Compaq Tru64 UNIX */
57 #define SMB_ACL_TAG_T acl_tag_t
58 #define SMB_ACL_TYPE_T acl_type_t
59 #define SMB_ACL_PERMSET_T acl_permset_t
60 #define SMB_ACL_PERM_T acl_perm_t
61 #define SMB_ACL_READ ACL_READ
62 #define SMB_ACL_WRITE ACL_WRITE
63 #define SMB_ACL_EXECUTE ACL_EXECUTE
65 /* Types of ACLs. */
66 #define SMB_ACL_USER ACL_USER
67 #define SMB_ACL_USER_OBJ ACL_USER_OBJ
68 #define SMB_ACL_GROUP ACL_GROUP
69 #define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ
70 #define SMB_ACL_OTHER ACL_OTHER
71 #define SMB_ACL_MASK ACL_MASK
73 #define SMB_ACL_T acl_t
75 #define SMB_ACL_ENTRY_T acl_entry_t
77 #define SMB_ACL_FIRST_ENTRY 0
78 #define SMB_ACL_NEXT_ENTRY 1
80 #define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
81 #define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
83 #elif defined(HAVE_UNIXWARE_ACLS) || defined(HAVE_SOLARIS_ACLS)
85 * Donated by Michael Davidson <md@sco.COM> for UnixWare / OpenUNIX.
86 * Modified by Toomas Soome <tsoome@ut.ee> for Solaris.
89 /* SVR4.2 ES/MP ACLs */
90 typedef int SMB_ACL_TAG_T;
91 typedef int SMB_ACL_TYPE_T;
92 typedef ushort *SMB_ACL_PERMSET_T;
93 typedef ushort SMB_ACL_PERM_T;
94 #define SMB_ACL_READ 4
95 #define SMB_ACL_WRITE 2
96 #define SMB_ACL_EXECUTE 1
98 /* Types of ACLs. */
99 #define SMB_ACL_USER USER
100 #define SMB_ACL_USER_OBJ USER_OBJ
101 #define SMB_ACL_GROUP GROUP
102 #define SMB_ACL_GROUP_OBJ GROUP_OBJ
103 #define SMB_ACL_OTHER OTHER_OBJ
104 #define SMB_ACL_MASK CLASS_OBJ
106 typedef struct SMB_ACL_T {
107 int size;
108 int count;
109 int next;
110 struct acl acl[1];
111 } *SMB_ACL_T;
113 typedef struct acl *SMB_ACL_ENTRY_T;
115 #define SMB_ACL_FIRST_ENTRY 0
116 #define SMB_ACL_NEXT_ENTRY 1
118 #define SMB_ACL_TYPE_ACCESS 0
119 #define SMB_ACL_TYPE_DEFAULT 1
121 #elif defined(HAVE_HPUX_ACLS)
124 * Based on the Solaris & UnixWare code.
127 #undef GROUP
128 #include <sys/aclv.h>
130 /* SVR4.2 ES/MP ACLs */
131 typedef int SMB_ACL_TAG_T;
132 typedef int SMB_ACL_TYPE_T;
133 typedef ushort *SMB_ACL_PERMSET_T;
134 typedef ushort SMB_ACL_PERM_T;
135 #define SMB_ACL_READ 4
136 #define SMB_ACL_WRITE 2
137 #define SMB_ACL_EXECUTE 1
139 /* Types of ACLs. */
140 #define SMB_ACL_USER USER
141 #define SMB_ACL_USER_OBJ USER_OBJ
142 #define SMB_ACL_GROUP GROUP
143 #define SMB_ACL_GROUP_OBJ GROUP_OBJ
144 #define SMB_ACL_OTHER OTHER_OBJ
145 #define SMB_ACL_MASK CLASS_OBJ
147 typedef struct SMB_ACL_T {
148 int size;
149 int count;
150 int next;
151 struct acl acl[1];
152 } *SMB_ACL_T;
154 typedef struct acl *SMB_ACL_ENTRY_T;
156 #define SMB_ACL_FIRST_ENTRY 0
157 #define SMB_ACL_NEXT_ENTRY 1
159 #define SMB_ACL_TYPE_ACCESS 0
160 #define SMB_ACL_TYPE_DEFAULT 1
162 #elif defined(HAVE_IRIX_ACLS)
164 #define SMB_ACL_TAG_T acl_tag_t
165 #define SMB_ACL_TYPE_T acl_type_t
166 #define SMB_ACL_PERMSET_T acl_permset_t
167 #define SMB_ACL_PERM_T acl_perm_t
168 #define SMB_ACL_READ ACL_READ
169 #define SMB_ACL_WRITE ACL_WRITE
170 #define SMB_ACL_EXECUTE ACL_EXECUTE
172 /* Types of ACLs. */
173 #define SMB_ACL_USER ACL_USER
174 #define SMB_ACL_USER_OBJ ACL_USER_OBJ
175 #define SMB_ACL_GROUP ACL_GROUP
176 #define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ
177 #define SMB_ACL_OTHER ACL_OTHER_OBJ
178 #define SMB_ACL_MASK ACL_MASK
180 typedef struct SMB_ACL_T {
181 int next;
182 BOOL freeaclp;
183 struct acl *aclp;
184 } *SMB_ACL_T;
186 #define SMB_ACL_ENTRY_T acl_entry_t
188 #define SMB_ACL_FIRST_ENTRY 0
189 #define SMB_ACL_NEXT_ENTRY 1
191 #define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
192 #define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
194 #elif defined(HAVE_AIX_ACLS)
196 /* Donated by Medha Date, mdate@austin.ibm.com, for IBM */
198 #include <acl.h>
200 typedef uint *SMB_ACL_PERMSET_T;
202 struct acl_entry_link{
203 struct acl_entry_link *prevp;
204 struct new_acl_entry *entryp;
205 struct acl_entry_link *nextp;
206 int count;
209 struct new_acl_entry{
210 unsigned short ace_len;
211 unsigned short ace_type;
212 unsigned int ace_access;
213 struct ace_id ace_id[1];
216 #define SMB_ACL_ENTRY_T struct new_acl_entry*
217 #define SMB_ACL_T struct acl_entry_link*
219 #define SMB_ACL_TAG_T unsigned short
220 #define SMB_ACL_TYPE_T int
221 #define SMB_ACL_PERM_T uint
222 #define SMB_ACL_READ S_IRUSR
223 #define SMB_ACL_WRITE S_IWUSR
224 #define SMB_ACL_EXECUTE S_IXUSR
226 /* Types of ACLs. */
227 #define SMB_ACL_USER ACEID_USER
228 #define SMB_ACL_USER_OBJ 3
229 #define SMB_ACL_GROUP ACEID_GROUP
230 #define SMB_ACL_GROUP_OBJ 4
231 #define SMB_ACL_OTHER 5
232 #define SMB_ACL_MASK 6
235 #define SMB_ACL_FIRST_ENTRY 1
236 #define SMB_ACL_NEXT_ENTRY 2
238 #define SMB_ACL_TYPE_ACCESS 0
239 #define SMB_ACL_TYPE_DEFAULT 1
241 #else /* No ACLs. */
243 /* No ACLS - fake it. */
244 #define SMB_ACL_TAG_T int
245 #define SMB_ACL_TYPE_T int
246 #define SMB_ACL_PERMSET_T mode_t
247 #define SMB_ACL_PERM_T mode_t
248 #define SMB_ACL_READ S_IRUSR
249 #define SMB_ACL_WRITE S_IWUSR
250 #define SMB_ACL_EXECUTE S_IXUSR
252 /* Types of ACLs. */
253 #define SMB_ACL_USER 0
254 #define SMB_ACL_USER_OBJ 1
255 #define SMB_ACL_GROUP 2
256 #define SMB_ACL_GROUP_OBJ 3
257 #define SMB_ACL_OTHER 4
258 #define SMB_ACL_MASK 5
260 typedef struct SMB_ACL_T {
261 int dummy;
262 } *SMB_ACL_T;
264 typedef struct SMB_ACL_ENTRY_T {
265 int dummy;
266 } *SMB_ACL_ENTRY_T;
268 #define SMB_ACL_FIRST_ENTRY 0
269 #define SMB_ACL_NEXT_ENTRY 1
271 #define SMB_ACL_TYPE_ACCESS 0
272 #define SMB_ACL_TYPE_DEFAULT 1
274 #endif /* No ACLs. */
275 #endif /* _SMB_ACLS_H */