1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
/* ACCESS CONTROL LIST ROUTINES
*/
#ifndef HTACL_H
#define HTACL_H
#include <HTAAUtil.h>
#include <HTGroup.h>
#ifdef SHORT_NAMES
#define HTAA_openAcl HTAAoACL
#define HTAA_closeAcl HTAAcACL
#define HTAA_getAclEntry HTAAgAEn
#endif /* SHORT_NAMES */
/*
Opening Access Control List File
*/
/* PUBLIC HTAA_openAcl()
** OPEN THE ACL FILE FOR THE GIVEN DOCUMENT
** ON ENTRY:
** pathname is the absolute pathname of
** the file to be accessed.
**
** ON EXIT:
** returns the FILE* to open ACL.
** NULL, if ACL not found.
*/
PUBLIC FILE *HTAA_openAcl PARAMS((CONST char * pathname));
/* PUBLIC HTAA_closeAcl()
** CLOSE ACL FILE
** ON ENTRY:
** acl_file is Access Control List file to close.
**
** ON EXIT:
** returns nothing.
*/
PUBLIC void HTAA_closeAcl PARAMS((FILE * acl_file));
/*
Getting ACL Entry
*/
/* PUBLIC HTAA_getAclEntry()
** CONSULT THE ACCESS CONTROL LIST AND
** GIVE A LIST OF GROUPS (AND USERS)
** AUTHORIZED TO ACCESS A GIVEN FILE
** ON ENTRY:
** acl_file is an open ACL file.
** pathname is the absolute pathname of
** the file to be accessed.
** method is the method for which access is wanted.
**
** ALC FILE FORMAT:
**
** template : method, method, ... : group@addr, user, group, ...
**
** The last item is in fact in exactly the same format as
** group definition in group file, i.e., everything that
** follows the 'groupname:' part,
** e.g.
** user, group, user@address, group@address,
** (user,group,...)@(address, address, ...)
**
** ON EXIT:
** returns NULL, if there is no entry for the file in the ACL,
** or ACL doesn't exist.
** If there is, a GroupDef object containing the
** group and user names allowed to access the file
** is returned (this is automatically freed
** next time this function is called).
** IMPORTANT:
** Returns the first entry with matching template and
** method. This function should be called multiple times
** to process all the valid entries (until it returns NULL).
** This is because there can be multiple entries like:
**
** *.html : get,put : ari,timbl,robert
** *.html : get : jim,james,jonathan,jojo
**
** NOTE:
** The returned group definition may well contain references
** to groups defined in group file. Therefore these references
** must be resolved according to that rule file by function
** HTAA_resolveGroupReferences() (group file is read in by
** HTAA_readGroupFile()) and after that access authorization
** can be checked with function HTAA_userAndInetGroup().
*/
PUBLIC GroupDef *HTAA_getAclEntry PARAMS((FILE * acl_file,
CONST char * pathname,
HTAAMethod method));
/*
*/
#endif /* not HTACL_H */
/*
End of file HTACL.h. */
|