smb_acls.h

説明を見る。
00001 /* 
00002    Unix SMB/Netbios implementation.
00003    Version 2.2.x
00004    Portable SMB ACL interface
00005    Copyright (C) Jeremy Allison 2000
00006    
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011    
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016    
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020 */
00021 
00022 #ifndef _SMB_ACLS_H
00023 #define _SMB_ACLS_H
00024 
00025 #if defined HAVE_POSIX_ACLS
00026 
00027 /* This is an identity mapping (just remove the SMB_). */
00028 
00029 #define SMB_ACL_TAG_T           acl_tag_t
00030 #define SMB_ACL_TYPE_T          acl_type_t
00031 #define SMB_ACL_PERMSET_T       acl_permset_t
00032 #define SMB_ACL_PERM_T          acl_perm_t
00033 #define SMB_ACL_READ            ACL_READ
00034 #define SMB_ACL_WRITE           ACL_WRITE
00035 #define SMB_ACL_EXECUTE         ACL_EXECUTE
00036 
00037 /* Types of ACLs. */
00038 #define SMB_ACL_USER            ACL_USER
00039 #define SMB_ACL_USER_OBJ        ACL_USER_OBJ
00040 #define SMB_ACL_GROUP           ACL_GROUP
00041 #define SMB_ACL_GROUP_OBJ       ACL_GROUP_OBJ
00042 #define SMB_ACL_OTHER           ACL_OTHER
00043 #define SMB_ACL_MASK            ACL_MASK
00044 
00045 #define SMB_ACL_T               acl_t
00046 
00047 #define SMB_ACL_ENTRY_T         acl_entry_t
00048 
00049 #define SMB_ACL_FIRST_ENTRY     ACL_FIRST_ENTRY
00050 #define SMB_ACL_NEXT_ENTRY      ACL_NEXT_ENTRY
00051 
00052 #define SMB_ACL_TYPE_ACCESS     ACL_TYPE_ACCESS
00053 #define SMB_ACL_TYPE_DEFAULT    ACL_TYPE_DEFAULT
00054 
00055 #elif defined HAVE_TRU64_ACLS
00056 
00057 /* This is for DEC/Compaq Tru64 UNIX */
00058 
00059 #define SMB_ACL_TAG_T           acl_tag_t
00060 #define SMB_ACL_TYPE_T          acl_type_t
00061 #define SMB_ACL_PERMSET_T       acl_permset_t
00062 #define SMB_ACL_PERM_T          acl_perm_t
00063 #define SMB_ACL_READ            ACL_READ
00064 #define SMB_ACL_WRITE           ACL_WRITE
00065 #define SMB_ACL_EXECUTE         ACL_EXECUTE
00066 
00067 /* Types of ACLs. */
00068 #define SMB_ACL_USER            ACL_USER
00069 #define SMB_ACL_USER_OBJ        ACL_USER_OBJ
00070 #define SMB_ACL_GROUP           ACL_GROUP
00071 #define SMB_ACL_GROUP_OBJ       ACL_GROUP_OBJ
00072 #define SMB_ACL_OTHER           ACL_OTHER
00073 #define SMB_ACL_MASK            ACL_MASK
00074 
00075 #define SMB_ACL_T               acl_t
00076 
00077 #define SMB_ACL_ENTRY_T         acl_entry_t
00078 
00079 #define SMB_ACL_FIRST_ENTRY     0
00080 #define SMB_ACL_NEXT_ENTRY      1
00081 
00082 #define SMB_ACL_TYPE_ACCESS     ACL_TYPE_ACCESS
00083 #define SMB_ACL_TYPE_DEFAULT    ACL_TYPE_DEFAULT
00084 
00085 #elif defined HAVE_UNIXWARE_ACLS || defined HAVE_SOLARIS_ACLS
00086 /*
00087  * Donated by Michael Davidson <md@sco.COM> for UnixWare / OpenUNIX.
00088  * Modified by Toomas Soome <tsoome@ut.ee> for Solaris.
00089  */
00090 
00091 /* SVR4.2 ES/MP ACLs */
00092 typedef int SMB_ACL_TAG_T;
00093 typedef int SMB_ACL_TYPE_T;
00094 typedef ushort *SMB_ACL_PERMSET_T;
00095 typedef ushort SMB_ACL_PERM_T;
00096 #define SMB_ACL_READ            4
00097 #define SMB_ACL_WRITE           2
00098 #define SMB_ACL_EXECUTE         1
00099 
00100 /* Types of ACLs. */
00101 #define SMB_ACL_USER            USER
00102 #define SMB_ACL_USER_OBJ        USER_OBJ
00103 #define SMB_ACL_GROUP           GROUP
00104 #define SMB_ACL_GROUP_OBJ       GROUP_OBJ
00105 #define SMB_ACL_OTHER           OTHER_OBJ
00106 #define SMB_ACL_MASK            CLASS_OBJ
00107 
00108 typedef struct SMB_ACL_T {
00109         int size;
00110         int count;
00111         int next;
00112         struct acl acl[1];
00113 } *SMB_ACL_T;
00114 
00115 typedef struct acl *SMB_ACL_ENTRY_T;
00116 
00117 #define SMB_ACL_FIRST_ENTRY     0
00118 #define SMB_ACL_NEXT_ENTRY      1
00119 
00120 #define SMB_ACL_TYPE_ACCESS     0
00121 #define SMB_ACL_TYPE_DEFAULT    1
00122 
00123 #ifdef __CYGWIN__
00124 #define SMB_ACL_LOSES_SPECIAL_MODE_BITS
00125 #endif
00126 
00127 #elif defined HAVE_HPUX_ACLS
00128 
00129 /*
00130  * Based on the Solaris & UnixWare code.
00131  */
00132 
00133 #undef GROUP
00134 #include <sys/aclv.h>
00135 
00136 /* SVR4.2 ES/MP ACLs */
00137 typedef int SMB_ACL_TAG_T;
00138 typedef int SMB_ACL_TYPE_T;
00139 typedef ushort *SMB_ACL_PERMSET_T;
00140 typedef ushort SMB_ACL_PERM_T;
00141 #define SMB_ACL_READ            4
00142 #define SMB_ACL_WRITE           2
00143 #define SMB_ACL_EXECUTE         1
00144 
00145 /* Types of ACLs. */
00146 #define SMB_ACL_USER            USER
00147 #define SMB_ACL_USER_OBJ        USER_OBJ
00148 #define SMB_ACL_GROUP           GROUP
00149 #define SMB_ACL_GROUP_OBJ       GROUP_OBJ
00150 #define SMB_ACL_OTHER           OTHER_OBJ
00151 #define SMB_ACL_MASK            CLASS_OBJ
00152 
00153 typedef struct SMB_ACL_T {
00154         int size;
00155         int count;
00156         int next;
00157         struct acl acl[1];
00158 } *SMB_ACL_T;
00159 
00160 typedef struct acl *SMB_ACL_ENTRY_T;
00161 
00162 #define SMB_ACL_FIRST_ENTRY     0
00163 #define SMB_ACL_NEXT_ENTRY      1
00164 
00165 #define SMB_ACL_TYPE_ACCESS     0
00166 #define SMB_ACL_TYPE_DEFAULT    1
00167 
00168 #elif defined HAVE_IRIX_ACLS
00169 
00170 #define SMB_ACL_TAG_T           acl_tag_t
00171 #define SMB_ACL_TYPE_T          acl_type_t
00172 #define SMB_ACL_PERMSET_T       acl_permset_t
00173 #define SMB_ACL_PERM_T          acl_perm_t
00174 #define SMB_ACL_READ            ACL_READ
00175 #define SMB_ACL_WRITE           ACL_WRITE
00176 #define SMB_ACL_EXECUTE         ACL_EXECUTE
00177 
00178 /* Types of ACLs. */
00179 #define SMB_ACL_USER            ACL_USER
00180 #define SMB_ACL_USER_OBJ        ACL_USER_OBJ
00181 #define SMB_ACL_GROUP           ACL_GROUP
00182 #define SMB_ACL_GROUP_OBJ       ACL_GROUP_OBJ
00183 #define SMB_ACL_OTHER           ACL_OTHER_OBJ
00184 #define SMB_ACL_MASK            ACL_MASK
00185 
00186 typedef struct SMB_ACL_T {
00187         int next;
00188         BOOL freeaclp;
00189         struct acl *aclp;
00190 } *SMB_ACL_T;
00191 
00192 #define SMB_ACL_ENTRY_T         acl_entry_t
00193 
00194 #define SMB_ACL_FIRST_ENTRY     0
00195 #define SMB_ACL_NEXT_ENTRY      1
00196 
00197 #define SMB_ACL_TYPE_ACCESS     ACL_TYPE_ACCESS
00198 #define SMB_ACL_TYPE_DEFAULT    ACL_TYPE_DEFAULT
00199 
00200 #elif defined HAVE_AIX_ACLS
00201 
00202 /* Donated by Medha Date, mdate@austin.ibm.com, for IBM */
00203 
00204 #include "/usr/include/acl.h"
00205 
00206 typedef uint *SMB_ACL_PERMSET_T;
00207  
00208 struct acl_entry_link{
00209         struct acl_entry_link *prevp;
00210         struct new_acl_entry *entryp;
00211         struct acl_entry_link *nextp;
00212         int count;
00213 };
00214 
00215 struct new_acl_entry{
00216         unsigned short ace_len;
00217         unsigned short ace_type;
00218         unsigned int ace_access;
00219         struct ace_id ace_id[1];
00220 };
00221 
00222 #define SMB_ACL_ENTRY_T         struct new_acl_entry*
00223 #define SMB_ACL_T               struct acl_entry_link*
00224  
00225 #define SMB_ACL_TAG_T           unsigned short
00226 #define SMB_ACL_TYPE_T          int
00227 #define SMB_ACL_PERM_T          uint
00228 #define SMB_ACL_READ            S_IRUSR
00229 #define SMB_ACL_WRITE           S_IWUSR
00230 #define SMB_ACL_EXECUTE         S_IXUSR
00231 
00232 /* Types of ACLs. */
00233 #define SMB_ACL_USER            ACEID_USER
00234 #define SMB_ACL_USER_OBJ        3
00235 #define SMB_ACL_GROUP           ACEID_GROUP
00236 #define SMB_ACL_GROUP_OBJ       4
00237 #define SMB_ACL_OTHER           5
00238 #define SMB_ACL_MASK            6
00239 
00240 
00241 #define SMB_ACL_FIRST_ENTRY     1
00242 #define SMB_ACL_NEXT_ENTRY      2
00243 
00244 #define SMB_ACL_TYPE_ACCESS     0
00245 #define SMB_ACL_TYPE_DEFAULT    1
00246 
00247 #else /* No ACLs. */
00248 
00249 /* No ACLS - fake it. */
00250 #define SMB_ACL_TAG_T           int
00251 #define SMB_ACL_TYPE_T          int
00252 #define SMB_ACL_PERMSET_T       mode_t
00253 #define SMB_ACL_PERM_T          mode_t
00254 #define SMB_ACL_READ            S_IRUSR
00255 #define SMB_ACL_WRITE           S_IWUSR
00256 #define SMB_ACL_EXECUTE         S_IXUSR
00257 
00258 /* Types of ACLs. */
00259 #define SMB_ACL_USER            0
00260 #define SMB_ACL_USER_OBJ        1
00261 #define SMB_ACL_GROUP           2
00262 #define SMB_ACL_GROUP_OBJ       3
00263 #define SMB_ACL_OTHER           4
00264 #define SMB_ACL_MASK            5
00265 
00266 typedef struct SMB_ACL_T {
00267         int dummy;
00268 } *SMB_ACL_T;
00269 
00270 typedef struct SMB_ACL_ENTRY_T {
00271         int dummy;
00272 } *SMB_ACL_ENTRY_T;
00273 
00274 #define SMB_ACL_FIRST_ENTRY     0
00275 #define SMB_ACL_NEXT_ENTRY      1
00276 
00277 #define SMB_ACL_TYPE_ACCESS     0
00278 #define SMB_ACL_TYPE_DEFAULT    1
00279 
00280 #endif /* No ACLs. */
00281 #endif /* _SMB_ACLS_H */

rsyncに対してSat Dec 5 19:45:42 2009に生成されました。  doxygen 1.4.7