krb_svc_init.3krb

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3KRB 代码 · 共 428 行

3KRB
428
字号
.TH krb_svc_init 3krb.SH Namekrb_svc_init, krb_get_svc_in_tkt, krb_get_pw_in_tkt \- Kerberos authentication initialization routines.SH Syntax.nf.nj \fB#include <krb.h>\fP \fB#include <des.h>\fP.PP \fBkrb_svc_init\fP  (\fIuser, instance, realm, lifetime,\fP                       \fIsrvtab_file, tkt_file\fP) \fBchar\fP	\fI*user, *instance, *realm\fP; \fBint\fP	\fIlifetime\fP; \fBchar\fP	\fI*srvtab_file\fP, \fI*tkt_file\fP;.PP \fBkrb_get_svc_in_tkt\fP  (\fIuser, instance, realm, service,\fP                            \fIservice_instance, lifetime,\fP                            \fIsrvtab_file\fP) \fBchar\fP	\fI*user, *instance, *realm, *service,\fP;  \fBchar\fP     \fI*service_instance\fP; \fBint\fP	\fIlifetime\fP; \fBchar\fP	\fI*srvtab_file\fP;.PP \fBkrb_get_pw_in_tkt\fP  (\fIuser, instance, realm, service,                              service_instance, lifetime,                              password\fP) \fBchar\fP	\fI*user, *instance, *realm,\fP;  \fBchar\fP     \fI*service, *service_instance\fP; \fBint\fP	\fIlifetime\fP; \fBchar\fP	\fI*password\fP;.PP.fi.SH Arguments.TP 9.I userFor.PN krb_get_svc_in_tktand.PN krb_get_pw_in_tkt ,the primary name of the principal that is obtaining a ticket that willauthenticate it to principal, \fIservice\fP.  For.PN krb_svc_init ,the primary name of the principal that is obtaining a ticket to communicatewith the ticket-granting service..TP.I instanceFor.PN krb_get_svc_in_tktand.PN krb_get_pw_in_tkt ,the instance name of the principal that is obtaininga ticket that will authenticate it to principal, \fIservice\fP.For.PN krb_svc_init ,the instance name of the principal that is obtaining a ticket to communicatewith the ticket-granting service..TP.I realmFor.PN krb_get_svc_in_tktand.PN krb_get_pw_in_tkt ,the realm name of the principal that is obtaininga ticket that will authenticate it to principal, \fIservice\fP.For.PN krb_svc_init ,the realm name of the principal that is obtaining a ticket to communicate withthe ticket-granting service..TP.I serviceThe primary name of the service for which a ticket willbe obtained..TP.I service_instanceThe instance of the service for which a ticket will beobtained..TP.I lifetimeThe number of five-minute intervals for which the obtainedticket should be valid.  Values greater than 255 will beset to 255.  Values greater than the maximum lifetimeallowed for tickets given to the requesting principalwill be set to the maximum lifetime allowed.  The maximumlifetime of the tickets granted to a principal is determinedwhen the principal is added to the Kerberos database..TP.I srvtab_fileThe path name of the file that contains thekey of the principal obtaining a ticket.  If this valueis set to the NULL pointer, the default service table (srvtab) filevalue is used.  The default srvtab file value is set bydefault	to.PN /etc/srvtab ,although this value can be changed bya call to the.PN krb_set_srvtab_stringfunction.  (Refer to.PN krb_set_tkt_string(3krb) ). .TP	.I tkt_fileThe path name of the file into which the credentials andtickets of the user or service should be placed.  If the \fItkt_file\fPparameter is equal to the NULL pointer, then thedefault ticket file value is used.  The default ticket filevalue is set equal to.PN /var/dss/kerberos/tkt/tkt.[\fIuid\fP] \fRwhere .PN uidis the user ID of the process that calls the abovefunctions.  The default	ticket file value can be changed bythe.PN krb_set_tkt_string(3krb)function call.\fP.TP.I passwordThe password of the principal that is obtaininga ticket that will authenticate it to principal, \fIservice\fP.If the password input is the NULL string, then.PN krb_get_pw_in_tktwill prompt for a password on .PN stdoutand read the password from .PN stdin ..SH Description.NXR "Kerberos routines" "krb_svc_init".NXR "Kerberos routines" "krb_get_svc_in_tkt".NXR "Kerberos routines" "krb_get_pw_in_tkt"The.PN krb_svc_init(3krb)routines are designed to obtain for the requestingprincipal a ticket to communicate with a specific service.  They requirethat the password/key of the requesting principal beeither available as an argument, or available from the \fIsrvtab_file\fP argument orfrom .PN stdin .Since the .PN krb_svc_init(3krb)routines always requirea password, they are best used to obtain theticket used to communicate with the ticket-granting service.  The ticket-granting ticket is used by the other Kerberos routinesto obtain tickets to communicate with principals other than theticket-granting service, without needing the key ofthe principal..PPThe.PN krb_sendauth(3krb)routines as well as the .PN kerberos(3krb)routines will not work as intended without the presence of a ticket-grantingticket..PPThe routines of.PN krb_svc_init(3krb)are as follows:.sp 2 .IP krb_svc_init.PPFor the principal with a primary name of \fIuser\fP, an instance nameof \fIinstance\fP, and a realm name of \fIrealm\fP, the .PN krb_svc_initroutineobtains a ticket that the principal can use to communicate withthe ticket-granting service.  The key of the principal is readfrom \fIsrvtab_file\fP and the ticket obtained is placed in \fItkt_file\fP..PPIf the \fIrealm\fP argument is equivalent to the NULL string, then therealm of which the local host is a member, is used by default.If \fIlifetime\fP is equivalent to 0, then the default lifetime, 255, isused.If \fIsrvtab_file\fP is not equivalent to the NULL string, then the\fIsrvtab_file\fP parameter is used as the service table (srvtab) file name and thedefault srvtab file is set equal to the \fIsrvtab_file\fP parameter.If \fIsrvtab_file\fP is equivalent to NULL, then the default srvtabfile is used.  If the \fItkt_file\fP parameter is not equivalent to theNULL string, then the \fItkt_file\fP parameter is used as the ticketfile name and the default ticket file is set equal to the\fItkt_file\fP parameter.  If the \fItkt_file\fP parameter is NULL, then thedefault ticket file value is used..PP.PN krb_svc_initreturns INT_OK if.PN krb_svc_inithas successfully obtained a ticket-granting ticket.  The following is a listof most of the error values returned from.PN krb_svc_initand their possible cause:.TP 9KFAILUREThe.PN /etc/krb.conffile (see.PN krb.conf(5krb) )cannot be opened or it is not properlyformed, or.brThe service table (srvtab) file does not exist, or.brA read of the srvtab file failed, or.brThe srvtab file is badly formatted, or.brThe srvtab file did not contain the key	of the principalwith primary name, \fIuser\fP, or.brA write to the ticket file failed..TP 9SKDC_CANTA Kerberos server must be contacted so that.PN krb_svc_initcan perform its function, butthe attempt cannot be made because a socketcannot be opened or bound, orthere is no Kerberos server listed in .PN /etc/krb.conf ..TP 9SKDC_RETRYA Kerberos server needs to be contacted, but none responded even after several attempts..TP 9INTK_PROTKerberos protocol version mismatch.  The version of theKerberos protocol supported by .PN krb_svc_initdoes not matchthe Kerberos protocol version supported by the .PN kerberos(8krb)daemon..TP 9INTK_BADPWThe ticket returned by the .PN kerberosdaemon did not decryptcorrectly.  This is usually caused by an incorrectservice password..TP 9INTK_ERRThe ticket sent from the .PN kerberosdaemon was not a ticketto communicate with the ticket-granting service, or.brThe ticket file cannot be accessed, or.brThe ticket file could not be created, or.brA write operation to the ticket file failed..TP 9TKT_FIL_LCKThe ticket file could not be locked for access..sp 2 .IP krb_get_svc_in_tkt.PPFor the principal with a primary name of \fIuser\fP, an instance nameof \fIinstance\fP and a realm name of \fIrealm\fP, the .PN krb_get_svc_in_tktroutine obtains a ticket to communicate with the principal thathas a primary name of \fIservice\fP and an instance name of\fIservice_instance\fP.  The key of the requesting primary is read fromthe file \fIsrvtab_file\fP and the tickets are placed in the defaultticket file.  If the \fIsrvtab_file\fP argument is equivalent to theNULL string, then the default srvtab file value is used insteadof the \fIsrvtab_file\fP parameter.  The default srvtab file value anddefault ticket file value can be changed respectively by.PN krb_set_srvtab_stingand.PN krb_set_tkt_string .To obtain theticket-granting ticket, the \fIservice\fP parameter must be set equalto "krbtgt" and the \fIservice_instance\fP argument must be set equalto the realm name of the local realm..PP.PN krb_get_svc_in_tktreturns INT_OK if .PN krb_get_svc_in_tkthas successfully obtained a ticket to communicate with principal, \fIservice\fP.The following is a list of most of the error values returned from.PN krb_get_svc_in_tktand their possible causes:.TP 9KFAILUREThe.PN /etc/krb.conffile cannot be opened or it is not properly.brformed, or.brA read of the service table (srvtab) file failed, or.brThe srvtab file did not contain the key	of the principalwith primary name, \fIuser\fP, or.brA write to the ticket file failed..TP 9SKDC_CANTA Kerberos server must be contacted in orderfor.PN krb_svc_initto perform its function, butthe attempt cannot be made because a socketcannot be opened or bound, orthere is no Kerberos server listed in .PN /etc/krb.conf ..TP 9SKDC_RETRYA Kerberos server needs to be contacted butnone responded even after several attempts..TP 9INTK_PROTKerberos protocol version mismatch.  The version of theKerberos protocol supported by .PN krb_get_svc_in_tktdoes not matchthe Kerberos protocol version supported by the .PN kerberosdaemon..TP 9INTK_BADPWThe ticket returned by the .PN kerberosdaemon did not decryptcorrectly.  This is usually caused by an incorrectservice password..TP 9INTK_ERRThe ticket sent from the .PN kerberosdaemon was not a ticketto communicate with the ticket-granting service, or.brThe ticket file cannot be accessed, or.brThe ticket file could not be created, or.brA write operation to the ticket file failed..TP 9TKT_FIL_LCKThe ticket file could not be locked for access..sp 2 .IP krb_get_pw_in_tkt.PPFor the principal with a primary name of \fIuser\fP, an instance nameof \fIinstance\fP, and a realm name of \fIrealm\fP, the.PN krb_get_pw_in_tktroutineobtains a ticket to communicate with the principal with a primaryname of \fIservice\fP and an instance name of \fIservice_instance\fP.The key ofthe principal must be input either as the \fIpassword\fP parameter or,if the password field is equivalent to the NULL string, the passwordmust be input from.PN stdin ..PPThe tickets that are obtained are placed in the default ticketfile.  The default ticket file can be changed by the.PN krb_set_tkt_stringfunction.  To obtain the ticket-grantingticket, the \fIservice\fP parameter must be set equal to "krbtgt" andthe \fIservice_instance\fP argument must be set equal to the realm nameof the local realm..PP.PN krb_get_pw_in_tktreturns INT_OK if .PN krb_get_pw_in_tkthassuccessfully obtained a ticket to communicate with principal, \fIservice\fP.The following is a list of most of the error values returned from.PN krb_get_pw_in_tktand their possible causes:.TP 9KFAILURE.PN /etc/krb.conffile cannot be opened or it is not properlyformed.A write to the ticket file failed..TP 9SKDC_CANTA Kerberos server must be contacted in orderfor .PN krb_svc_initto perform its function butthe attempt cannot be made because a socketcannot be opened or bound, orthere is no Kerberos server listed in .PN /etc/krb.conf ..TP 9SKDC_RETRYA Kerberos server needs to be contacted butnone responded even after several attempts..TP 9INTK_PROTKerberos protocol version mismatch.  The version of theKerberos protocol supported by .PN krb_get_pw_in_tktdoes not matchthe Kerberos protocol version supported by the .PN kerberosdaemon..TP 9INTK_BADPWThe ticket returned by the .PN kerberosdaemon did not decryptcorrectly.  This is usually caused by an incorrectuser password..TP 9INTK_ERRThe ticket sent from the .PN kerberosdaemon was not a ticketto communicate with the ticket-granting service, or.brThe ticket file cannot be accessed, or.brThe ticket file could not be created, or.brA write operation to the ticket file failed..TP 9TKT_FIL_LCKThe ticket file could not be locked for access..SH See Alsokrb_get_lrealm(3krb), krb_set_tkt_string(3krb), kerberos(3krb),krb_sendauth(3krb), kerberos(8krb)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?