5 An access control list (ACL) is a list of principals, where each
6 principal is is represented by a text string which cannot contain
7 whitespace. The library allows application programs to refer to named
8 access control lists to test membership and to atomically add and
9 delete principals using a natural and intuitive interface. At
10 present, the names of access control lists are required to be Unix
11 filenames, and refer to human-readable Unix files; in the future, when
12 a networked ACL server is implemented, the names may refer to a
13 different namespace specific to the ACL service.
18 cc <files> -lacl -lkrb.
24 Principal names have the form
26 <name>[.<instance>][@<realm>]
34 asp.root@ATHENA.MIT.EDU
36 It is possible for principals to be underspecified. If instance is
37 missing, it is assumed to be "". If realm is missing, it is assumed
38 to be local_realm. The canonical form contains all of name, instance,
39 and realm; the acl_add and acl_delete routines will always
40 leave the file in that form. Note that the canonical form of
41 asp@ATHENA.MIT.EDU is actually asp.@ATHENA.MIT.EDU.
46 acl_canonicalize_principal(principal, buf)
50 Store the canonical form of principal in buf. Buf must contain enough
51 space to store a principal, given the limits on the sizes of name,
52 instance, and realm specified in /usr/include/krb.h.
54 acl_check(acl, principal)
58 Returns nonzero if principal appears in acl. Returns 0 if principal
59 does not appear in acl, or if an error occurs. Canonicalizes
60 principal before checking, and allows the ACL to contain wildcards.
62 acl_exact_match(acl, principal)
66 Like acl_check, but does no canonicalization or wildcarding.
68 acl_add(acl, principal)
72 Atomically adds principal to acl. Returns 0 if successful, nonzero
73 otherwise. It is considered a failure if principal is already in acl.
74 This routine will canonicalize principal, but will treat wildcards
77 acl_delete(acl, principal)
81 Atomically deletes principal from acl. Returns 0 if successful,
82 nonzero otherwise. It is consider a failure if principal is not
83 already in acl. This routine will canonicalize principal, but will
84 treat wildcards literally.
86 acl_initialize(acl, mode)
90 Initialize acl. If acl file does not exist, creates it with mode
91 mode. If acl exists, removes all members. Returns 0 if successful,
92 nonzero otherwise. WARNING: Mode argument is likely to change with
93 the eventual introduction of an ACL service.
98 In the presence of concurrency, there is a very small chance that
99 acl_add or acl_delete could report success even though it would have
100 had no effect. This is a necessary side effect of using lock files
101 for concurrency control rather than flock(2), which is not supported
104 The current implementation caches ACLs in memory in a hash-table
105 format for increased efficiency in checking membership; one effect of
106 the caching scheme is that one file descriptor will be kept open for
107 each ACL cached, up to a maximum of 8.