link in OS2-Client-HOWTO to SWAT main page
[Samba.git] / source / include / smb_acls.h
blob41d123871493ae6f78e4dc3da5449a30e0ec3d52
1 /*
2 Unix SMB/Netbios implementation.
3 Version 2.2.x
4 Portable SMB ACL interface
5 Copyright (C) Jeremy Allison 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 _SMB_ACLS_H
23 #define _SMB_ACLS_H
25 #include "includes.h"
27 #if defined(HAVE_POSIX_ACLS)
29 /* This is an identity mapping (just remove the SMB_). */
31 #define SMB_ACL_TAG_T acl_tag_t
32 #define SMB_ACL_TYPE_T acl_type_t
33 #define SMB_ACL_PERMSET_T acl_permset_t
34 #define SMB_ACL_PERM_T acl_perm_t
35 #define SMB_ACL_READ ACL_READ
36 #define SMB_ACL_WRITE ACL_WRITE
37 #define SMB_ACL_EXECUTE ACL_EXECUTE
39 /* Types of ACLs. */
40 #define SMB_ACL_USER ACL_USER
41 #define SMB_ACL_USER_OBJ ACL_USER_OBJ
42 #define SMB_ACL_GROUP ACL_GROUP
43 #define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ
44 #define SMB_ACL_OTHER ACL_OTHER
45 #define SMB_ACL_MASK ACL_MASK
47 #define SMB_ACL_T acl_t
49 #define SMB_ACL_ENTRY_T acl_entry_t
51 #define SMB_ACL_FIRST_ENTRY ACL_FIRST_ENTRY
52 #define SMB_ACL_NEXT_ENTRY ACL_NEXT_ENTRY
54 #define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
55 #define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
57 #elif defined(HAVE_UNIXWARE_ACLS)
60 * Donated by Michael Davidson <md@sco.COM> for UnixWare.
61 * As this is generic SVR4.x code, it may also work for Solaris !
64 /* SVR4.2 ES/MP ACLs */
65 typedef int SMB_ACL_TAG_T;
66 typedef int SMB_ACL_TYPE_T;
67 typedef ushort *SMB_ACL_PERMSET_T;
68 typedef ushort SMB_ACL_PERM_T;
69 #define SMB_ACL_READ S_IRUSR
70 #define SMB_ACL_WRITE S_IWUSR
71 #define SMB_ACL_EXECUTE S_IXUSR
73 /* Types of ACLs. */
74 #define SMB_ACL_USER USER
75 #define SMB_ACL_USER_OBJ USER_OBJ
76 #define SMB_ACL_GROUP GROUP
77 #define SMB_ACL_GROUP_OBJ GROUP_OBJ
78 #define SMB_ACL_OTHER OTHER_OBJ
79 #define SMB_ACL_MASK CLASS_OBJ
81 typedef struct SMB_ACL_T {
82 int size;
83 int count;
84 int next;
85 struct acl acl[1];
86 } *SMB_ACL_T;
88 typedef struct acl *SMB_ACL_ENTRY_T;
90 #define SMB_ACL_FIRST_ENTRY 0
91 #define SMB_ACL_NEXT_ENTRY 1
93 #define SMB_ACL_TYPE_ACCESS 0
94 #define SMB_ACL_TYPE_DEFAULT 1
96 #elif defined(HAVE_SOLARIS_ACLS)
99 * Code donated by Toomas Soome <tsoome@ut.ee>.
100 * Based on the implementation by Michael Davidson <md@sco.COM> for UnixWare.
103 typedef int SMB_ACL_TAG_T;
104 typedef int SMB_ACL_TYPE_T;
105 typedef ushort *SMB_ACL_PERMSET_T;
106 typedef ushort SMB_ACL_PERM_T;
107 #define SMB_ACL_READ 4
108 #define SMB_ACL_WRITE 2
109 #define SMB_ACL_EXECUTE 1
111 /* Types of ACLs. */
112 #define SMB_ACL_USER USER
113 #define SMB_ACL_USER_OBJ USER_OBJ
114 #define SMB_ACL_GROUP GROUP
115 #define SMB_ACL_GROUP_OBJ GROUP_OBJ
116 #define SMB_ACL_OTHER OTHER_OBJ
117 #define SMB_ACL_MASK CLASS_OBJ
119 typedef struct SMB_ACL_T {
120 int size;
121 int count;
122 int next;
123 struct acl acl[1];
124 } *SMB_ACL_T;
126 typedef struct acl *SMB_ACL_ENTRY_T;
128 #define SMB_ACL_FIRST_ENTRY 0
129 #define SMB_ACL_NEXT_ENTRY 1
131 #define SMB_ACL_TYPE_ACCESS 0
132 #define SMB_ACL_TYPE_DEFAULT 1
134 #elif defined(HAVE_IRIX_ACLS)
136 #define SMB_ACL_TAG_T acl_tag_t
137 #define SMB_ACL_TYPE_T acl_type_t
138 #define SMB_ACL_PERMSET_T acl_permset_t
139 #define SMB_ACL_PERM_T acl_perm_t
140 #define SMB_ACL_READ ACL_READ
141 #define SMB_ACL_WRITE ACL_WRITE
142 #define SMB_ACL_EXECUTE ACL_EXECUTE
144 /* Types of ACLs. */
145 #define SMB_ACL_USER ACL_USER
146 #define SMB_ACL_USER_OBJ ACL_USER_OBJ
147 #define SMB_ACL_GROUP ACL_GROUP
148 #define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ
149 #define SMB_ACL_OTHER ACL_OTHER_OBJ
150 #define SMB_ACL_MASK ACL_MASK
152 #define SMB_ACL_T acl_t
154 #define SMB_ACL_ENTRY_T acl_entry_t
156 #define SMB_ACL_FIRST_ENTRY 0
157 #define SMB_ACL_NEXT_ENTRY 1
159 #define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
160 #define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
162 #else /* No ACLs. */
164 /* No ACLS - fake it. */
165 #define SMB_ACL_TAG_T int
166 #define SMB_ACL_TYPE_T int
167 #define SMB_ACL_PERMSET_T mode_t
168 #define SMB_ACL_PERM_T mode_t
169 #define SMB_ACL_READ S_IRUSR
170 #define SMB_ACL_WRITE S_IWUSR
171 #define SMB_ACL_EXECUTE S_IXUSR
173 /* Types of ACLs. */
174 #define SMB_ACL_USER 0
175 #define SMB_ACL_USER_OBJ 1
176 #define SMB_ACL_GROUP 2
177 #define SMB_ACL_GROUP_OBJ 3
178 #define SMB_ACL_OTHER 4
179 #define SMB_ACL_MASK 5
181 typedef struct SMB_ACL_T {
182 int dummy;
183 } *SMB_ACL_T;
185 typedef struct SMB_ACL_ENTRY_T {
186 int dummy;
187 } *SMB_ACL_ENTRY_T;
189 #define SMB_ACL_FIRST_ENTRY 0
190 #define SMB_ACL_NEXT_ENTRY 1
192 #define SMB_ACL_TYPE_ACCESS 0
193 #define SMB_ACL_TYPE_DEFAULT 1
195 #endif /* No ACLs. */
196 #endif /* _SMB_ACLS_H */