gridsite-gacl.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-4, Andrew McNab, University of Manchester
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or
6  without modification, are permitted provided that the following
7  conditions are met:
8 
9  o Redistributions of source code must retain the above
10  copyright notice, this list of conditions and the following
11  disclaimer.
12  o Redistributions in binary form must reproduce the above
13  copyright notice, this list of conditions and the following
14  disclaimer in the documentation and/or other materials
15  provided with the distribution.
16 
17  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
18  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
19  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  POSSIBILITY OF SUCH DAMAGE.
30 */
31 
32 /*---------------------------------------------------------------*
33  * For more about GridSite: http://www.gridsite.org/ *
34  *---------------------------------------------------------------*/
35 
36 #ifndef HEADER_GACL_H
37 #define HEADER_GACL_H
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #ifndef GACL_LIB_VERSION
44 #define GACL_LIB_VERSION "x.x.x"
45 #endif
46 
48 
49 typedef int GACLaction;
50 typedef unsigned int GACLperm;
51 
53 
55 
57 
58 extern char *gacl_perm_syms[];
59 extern GACLperm gacl_perm_vals[];
60 
61 #define GACL_PERM_NONE GRST_PERM_NONE
62 #define GACL_PERM_READ GRST_PERM_READ
63 #define GACL_PERM_LIST GRST_PERM_LIST
64 #define GACL_PERM_WRITE GRST_PERM_WRITE
65 #define GACL_PERM_ADMIN GRST_PERM_ADMIN
66 
67 #define GACLhasNone(perm) (perm == 0)
68 #define GACLhasRead(perm) ((perm & GRST_PERM_READ) != 0)
69 #define GACLhasList(perm) ((perm & GRST_PERM_LIST) != 0)
70 #define GACLhasWrite(perm) ((perm & GRST_PERM_WRITE) != 0)
71 #define GACLhasAdmin(perm) ((perm & GRST_PERM_ADMIN) != 0)
72 
73 #define GACL_ACTION_ALLOW GRST_ACTION_ALLOW
74 #define GACL_ACTION_DENY GRST_ACTION_DENY
75 
76 #define GACL_ACL_FILE GRST_ACL_FILE
77 #define GACL_DN_LISTS GRST_DN_LISTS
78 
79 #define GACLinit() GRSTgaclInit()
80 
81 #define GACLnewCred(x) GRSTgaclCredNew((x))
82 /* GACLcred *GACLnewCred(char *); */
83 
84 #define GACLaddToCred(x,y,z) GRSTgaclCredAddValue((x),(y),(z))
85 /* int GACLaddToCred(GACLcred *, char *, char *); */
86 
87 #define GACLfreeCred(x) GRSTgaclCredFree((x))
88 /* int GACLfreeCred(GACLcred *); */
89 
90 #define GACLaddCred(x,y) GRSTgaclEntryAddCred((x),(y))
91 /* int GACLaddCred(GACLentry *, GACLcred *); */
92 
93 #define GACLdelCred(x,y) GRSTgaclEntryDelCred((x),(y))
94 /* int GACLdelCred(GACLentry *, GACLcred *); */
95 
96 #define GACLprintCred(x,y) GRSTgaclCredPrint((x),(y))
97 /* int GACLprintCred(GACLcred *, FILE *); */
98 
99 
100 #define GACLnewEntry() GRSTgaclEntryNew()
101 /* GACLentry *GACLnewEntry(void); */
102 
103 #define GACLfreeEntry(x) GRSTgaclEntryFree((x))
104 /* int GACLfreeEntry(GACLentry *); */
105 
106 #define GACLaddEntry(x,y) GRSTgaclAclAddEntry((x),(y))
107 /* int GACLaddEntry(GACLacl *, GACLentry *); */
108 
109 #define GACLprintEntry(x,y) GRSTgaclEntryPrint((x),(y))
110 /* int GACLprintEntry(GACLentry *, FILE *); */
111 
112 
113 #define GACLprintPerm(x,y) GRSTgaclPermPrint((x),(y))
114 /* int GACLprintPerm(GACLperm, FILE *); */
115 
116 #define GACLallowPerm(x,y) GRSTgaclEntryAllowPerm((x),(y))
117 /* int GACLallowPerm(GACLentry *, GACLperm); */
118 
119 #define GACLunallowPerm(x,y) GRSTgaclEntryUnallowPerm((x),(y))
120 /* int GACLunallowPerm(GACLentry *, GACLperm); */
121 
122 #define GACLdenyPerm(x,y) GRSTgaclEntryDenyPerm((x),(y))
123 /* int GACLdenyPerm(GACLentry *, GACLperm); */
124 
125 #define GACLundenyPerm(x,y) GRSTgaclEntryUndenyPerm((x),(y))
126 /* int GACLundenyPerm(GACLentry *, GACLperm); */
127 
128 #define GACLpermToChar(x) GRSTgaclPermToChar((x))
129 /* char *GACLpermToChar(GACLperm); */
130 
131 #define GACLcharToPerm(x) GRSTgaclPermFromChar((x))
132 /* GACLperm GACLcharToPerm(char *); */
133 
134 #define GACLnewAcl() GRSTgaclAclNew()
135 /* GACLacl *GACLnewAcl(void); */
136 
137 #define GACLfreeAcl(x) GRSTgaclAclFree((x))
138 /* int GACLfreeAcl(GACLacl *); */
139 
140 #define GACLprintAcl(x,y) GRSTgaclAclPrint((x),(y))
141 /* int GACLprintAcl(GACLacl *, FILE *); */
142 
143 #define GACLsaveAcl(x,y) GRSTgaclAclSave((y),(x))
144 /* int GACLsaveAcl(char *, GACLacl *); */
145 
146 #define GACLloadAcl(x) GRSTgaclAclLoadFile((x))
147 /* GACLacl *GACLloadAcl(char *); */
148 
149 #define GACLfindAclForFile(x) GRSTgaclFileFindAclname((x))
150 /* char *GACLfindAclForFile(char *); */
151 
152 #define GACLloadAclForFile(x) GRSTgaclAclLoadforFile((x))
153 /* GACLacl *GACLloadAclForFile(char *); */
154 
155 #define GACLisAclFile(x) GRSTgaclFileIsAcl((x))
156 /* int GACLisAclFile(char *); */
157 
158 
159 #define GACLnewUser(x) GRSTgaclUserNew((x))
160 /* GACLuser *GACLnewUser(GACLcred *); */
161 
162 #define GACLfreeUser(x) GRSTgaclUserFree((x))
163 /* int GACLfreeUser(GACLuser *); */
164 
165 #define GACLuserAddCred(x,y) GRSTgaclUserAddCred((x),(y))
166 /* int GACLuserAddCred(GACLuser *, GACLcred *); */
167 
168 #define GACLuserHasCred(x,y) GRSTgaclUserHasCred((x),(y))
169 /* int GACLuserHasCred(GACLuser *, GACLcred *); */
170 
171 #define GACLuserFindCredType(x,y) GRSTgaclUserFindCredtype((x),(y))
172 /* GACLcred *GACLuserFindCredType(GACLuser *, char *); */
173 
174 #define GACLtestDnList(x,y) GRSTgaclDNlistHasUser((x),(y))
175 /* int GACLtestDnList(char *, GACLuser *); */
176 
177 #define GACLtestUserAcl(x,y) GRSTgaclAclTestUser((x),(y))
178 /* GACLperm GACLtestUserAcl(GACLacl *, GACLuser *); */
179 
180 #define GACLtestExclAcl(x,y) GRSTgaclAclTestexclUser((x),(y))
181 /* GACLperm GACLtestExclAcl(GACLacl *, GACLuser *); */
182 
183 
184 #define GACLurlEncode(x) GRSThttpUrlEncode((x))
185 /* char *GACLurlEncode(char *); */
186 
187 #define GACLmildUrlEncode(x) GRSThttpUrlMildencode((x))
188 /* char *GACLmildUrlEncode(char *); */
189 
190 GRSTgaclEntry *GACLparseEntry(void *cur);
191 
192 #ifdef __cplusplus
193 } // extern "C"
194 #endif
195 
196 #endif // HEADER_GACL_H
GRSTgaclAcl GACLacl
Definition: gridsite-gacl.h:54
GRSTgaclEntry * GACLparseEntry(void *cur)
Definition: grst_gacl.c:1391
GRSTgaclUser GACLuser
Definition: gridsite-gacl.h:56
Definition: gridsite.h:133
int GACLaction
Definition: gridsite-gacl.h:49
Definition: gridsite.h:112
char * gacl_perm_syms[]
Definition: gridsite.h:135
GRSTgaclEntry GACLentry
Definition: gridsite-gacl.h:52
GRSTgaclCred GACLcred
Definition: gridsite-gacl.h:47
Definition: gridsite.h:128
unsigned int GACLperm
Definition: gridsite-gacl.h:50
GACLperm gacl_perm_vals[]