📄 acl_files.doc
字号:
PROTOTYPE ACL LIBRARYIntroduction An access control list (ACL) is a list of principals, where eachprincipal is is represented by a text string which cannot containwhitespace. The library allows application programs to refer to namedaccess control lists to test membership and to atomically add anddelete principals using a natural and intuitive interface. Atpresent, the names of access control lists are required to be Unixfilenames, and refer to human-readable Unix files; in the future, whena networked ACL server is implemented, the names may refer to adifferent namespace specific to the ACL service.Usagecc <files> -lacl -lkrb.Principal NamesPrincipal names have the form<name>[.<instance>][@<realm>]e.g.aspasp.rootasp@ATHENA.MIT.EDUasp.@ATHENA.MIT.EDUasp.root@ATHENA.MIT.EDUIt is possible for principals to be underspecified. If instance ismissing, it is assumed to be "". If realm is missing, it is assumedto be local_realm. The canonical form contains all of name, instance,and realm; the acl_add and acl_delete routines will alwaysleave the file in that form. Note that the canonical form ofasp@ATHENA.MIT.EDU is actually asp.@ATHENA.MIT.EDU.Routinesacl_canonicalize_principal(principal, buf)char *principal;char *buf; /*RETVAL*/Store the canonical form of principal in buf. Buf must contain enoughspace to store a principal, given the limits on the sizes of name,instance, and realm specified in /usr/include/krb.h.acl_check(acl, principal)char *acl;char *principal;Returns nonzero if principal appears in acl. Returns 0 if principaldoes not appear in acl, or if an error occurs. Canonicalizesprincipal before checking, and allows the ACL to contain wildcards.acl_exact_match(acl, principal)char *acl;char *principal;Like acl_check, but does no canonicalization or wildcarding.acl_add(acl, principal)char *acl;char *principal;Atomically adds principal to acl. Returns 0 if successful, nonzerootherwise. It is considered a failure if principal is already in acl.This routine will canonicalize principal, but will treat wildcardsliterally.acl_delete(acl, principal)char *acl;char *principal;Atomically deletes principal from acl. Returns 0 if successful,nonzero otherwise. It is consider a failure if principal is notalready in acl. This routine will canonicalize principal, but willtreat wildcards literally.acl_initialize(acl, mode)char *acl;int mode;Initialize acl. If acl file does not exist, creates it with modemode. If acl exists, removes all members. Returns 0 if successful,nonzero otherwise. WARNING: Mode argument is likely to change withthe eventual introduction of an ACL service. Known problemsIn the presence of concurrency, there is a very small chance thatacl_add or acl_delete could report success even though it would havehad no effect. This is a necessary side effect of using lock filesfor concurrency control rather than flock(2), which is not supportedby NFS.The current implementation caches ACLs in memory in a hash-tableformat for increased efficiency in checking membership; one effect ofthe caching scheme is that one file descriptor will be kept open foreach ACL cached, up to a maximum of 8.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -