acl_check.3krb
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3KRB 代码 · 共 204 行
3KRB
204 行
.TH acl_check 3krb.SH Nameacl_check \- Access control list (ACL) library routines..SH Syntax.nf.nj \fBcc <files> \-lacl \-l krb\fP.PP \fB#include <krb.h>\fP\fP.PP \fBacl_canonicalize_principal\fP (\fIprincipal, buf\fP) \fBchar\fP \fI*principal\fP; \fBchar\fP \fI*buf\fP;.PP \fBacl_check\fP (\fIacl_file, principal\fP) \fBchar\fP \fI*acl_file\fP; \fBchar\fP \fI*principal\fP;.PP \fBacl_exact_match\fP (\fIacl_file, principal\fP) \fBchar\fP \fI*acl_file\fP; \fBchar\fP \fI*principal\fP;.PP \fBacl_add\fP (\fIacl_file, principal\fP) \fBchar\fP \fI*acl_file\fP; \fBchar\fP \fI*principal\fP;.PP \fBacl_delete\fP (\fIacl_file, principal\fP) \fBchar\fP \fI*acl_file\fP; \fBchar\fP \fI*principal\fP;.PP \fBacl_initialize\fP (\fIacl_file, mode\fP) \fBchar\fP \fI*acl_file\fP; \fBint\fP \fImode\fP;.PP \fBkname_parse\fP (\fIprimary_name, instance_name\fP, \fIrealm_name, principal\fP) \fBchar\fP \fI*primary_name\fP; \fBchar\fP \fI*instance_name\fP; \fBchar\fP \fI*realm_name\fP; \fBchar\fP \fI*principal\fP;.fi.SH Arguments.TP 9.I principalThe name of a principal. Principal names consist of from one to three fields.The first field must be included because it stores the primary name of theprincipal. The second field is not always required. It begins with a period (.),and stores the instance name of the principal. The third field is notalways required. It begins with an "at" sign (@), and stores the realm name ofthe principal. The principal name format can be expressed as: .EXname[.instance][@realm].EEFor example, all of the names below are legitimate principal names:.EXvenusvenus.rootvenus@dec.comvenus.@dec.comvenus.root@dec.com.EE.TP.I bufPointer to the buffer that stores the canonical form of a principal name. Thecanonical form is derived from the form of a principal name. Like a principalname, it includes a primary name in its first field. Unlike a principal name,it must include an instance name as its next field even if the instance nameis blank. Also, unlike a principal name, it must contain a realm field. If acanonical name is derived from a principal name that has no realm field, thelocal realm returned by .PN krb_get_lrealm(3krb)is used as the realm field in the canonical name. Of the aboveexamples, only the last two are in canonical form. .TP.I acl_fileThe path name of the file in which the access control list (ACL) is stored..TP.I modeIf the ACL file, \fIacl_file\fP, does not currently exist when.PN acl_initializeis called, the file \fIacl_file\fP, is created with read, write, and accessmode bits set equal to \fImode\fP. .TP.I primary_nameThe primary name portion of \fIprincipal\fP, returned by.PN kname_parse .ANAME_SZ bytes of storage space must be allocated for \fIprimary_name\fP..TP.I instance_nameThe instance name of \fIprincipal\fP, returned by.PN kname_parse .INST_SZ bytes of storage space must be allocated for \fIinstance_name\fP..TP.I realm_nameThe realm name of \fIprincipal\fP, returned by.PN kname_parse .REALM_SZ bytes of storage space must be allocated for \fIrealm_name\fP..SH Description.NXR "Kerberos routines" "acl_canonicalize_principal".NXR "Kerberos routines" "acl_check".NXR "Kerberos routines" "acl_exact_match".NXR "Kerberos routines" "acl_add".NXR "Kerberos routines" "acl_delete".NXR "Kerberos routines" "acl_initialize".NXR "Kerberos routines" "kname_parse"The routines of the .PN acl_checklibrary allow you to perform various administrative functions on anaccess control list (ACL). An ACL is a list of Kerberos principalsin which each principal is represented by a text string.The routines of this library allow applicationprograms to refer to named ACLs to test whether a principal is a member of anACL, andto add or delete principals from the ACL file..PPThe routines of the \f(CWacl_check\fP library are:.IP acl_canonicalize_principalStores the canonical form of the principal name pointed to by\fIprincipal\fP in the buffer pointed to by \fIbuf\fP. This buffer mustcontain enough space to store a full canonical principal name (MAX_PRINCIPAL_SIZE characters). No meaningful value is returned by.PN acl_canonicalize_principal ..IP acl_checkVerifies that the principal name, \fIprincipal\fP, appears in the ACLfile, \fIacl_file\fP. This routine returns a zero (0) if the principal doesnot appear in the ACL, or if there is an error condition. If the principal isa member of the ACL, a one (1) is returned. The \f(CWacl_check\fProutine always canonicalizes a principal before trying to find it in the ACL..PN acl_checkwill determine if there is an ACL entry in the \fIacl_file\fP which exactlymatches principal, \fIprincipal\fP, or if \fIprincipal\fP matches an ACL entrywhich contains a wildcard. A wildcard appears in place of a field name in anACL entry and is represented as an asterisk (*). A wildcard in a field nameof an ACL entry allows the ACL entry to match a principal name that containsanything in that particular field. For example, if there is an entry,.PN venus.*@dec.comin the ACL, the principals,.PN venus.root@dec.com ,.PN venus.@dec.com ,and.PN venus.planet@dec.comwould be included in the ACL. The use of wildcards is limited, for they maybe used in only the three following configurations in an ACL file:.EXname.*@realm*.*@realm*.*@*.EE.IP acl_exact_matchVerifies that principal name, \fIprincipal\fP, appears in the ACL file,.PN acl_file .This routine returns a zero (0) if the principal does not appear in the ACL,or if any error occurs. If the principal is a member of the ACL,.PN acl_exact_matchreturns a non-zero. The.PN acl_exact_matchroutine does not canonicalize a principal before the ACL checks are made, andit does not support wildcards. Only an exact match is acceptable. So, forexample, if there is an entry,.PN venus.*@dec.comin the ACL, only the principal.PN venus.*@dec.comwould match the ACL entry. This routine makes it easy to find ACL entrieswith wildcards. .IP acl_addAdds the principal name, \fIprincipal\fP, to the ACL file,\fIacl_file\fP. This routine returns a zero (0) if it successfully adds the principal to the ACL. Otherwise, if there was an internal error, orif the principal is already in the ACL, the.PN acl_addroutine returns a non-zero value. The.PN acl_addroutine canonicalizes a principal, but treats wildcards literally..IP acl_deleteDeletes the principal, \fIprincipal\fP, from the ACL file, \fIacl_file\fP. The routine returns a zero (0) if it successfullydeletes the principal from the ACL. Otherwise, if there was an internal erroror if the principal is not in the ACL, the\f(CWacl_delete\fP routine returns a non-zero value.The.PN acl_deleteroutine canonicalizes a principal, buttreats wildcards literally..IP acl_initializeInitializes the ACL file, \fIacl_file\fP. If the named\fIacl_file\fP does not exist, \f(CWacl_initialize\fP creates one withthe permissions specified by the \fImode\fP argument. If the ACL exists,\f(CWacl_initialize\fP removes all previously stored principal membersof the list. This routine returns a zero (0) if successful or a nonzero if itfails..IP kname_parseparses the principal name, \fIprincipal\fP, and stores the primary name ofthe principal in \fIprincipal_name\fP, the instance name of the principalin \fIinstance_name\fP, and the realm name of the principal in \fIrealm_name\fP..PN kname_parsereturns KNAME_FMT if the principal name is incorrectly formatted or if it istoo long to be a principal name. It returns KSUCCESS if the parsing of theprincipal name succeeded..SH See Alsokerberos(3krb), krb_get_lrealm(3krb)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?