BSD 4_4_Lite2 development
[unix-history] / usr / share / man / cat3 / tf_util.0
TF_UTIL(3) BSD Programmer's Manual TF_UTIL(3)
N\bNA\bAM\bME\bE
tf_init, tf_get_pname, tf_get_pinst, tf_get_cred, tf_close
- routines for manipulating a Kerberos ticket file
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<k\bke\ber\brb\bbe\ber\bro\bos\bsI\bIV\bV/\b/k\bkr\brb\bb.\b.h\bh>\b>
e\bex\bxt\bte\ber\brn\bn c\bch\bha\bar\br *\b*k\bkr\brb\bb_\b_e\ber\brr\br_\b_t\btx\bxt\bt[\b[]\b];\b;
t\btf\bf_\b_i\bin\bni\bit\bt(\b(t\btf\bf_\b_n\bna\bam\bme\be,\b, r\brw\bw)\b)
c\bch\bha\bar\br *\b*t\btf\bf_\b_n\bna\bam\bme\be;\b;
i\bin\bnt\bt r\brw\bw;\b;
t\btf\bf_\b_g\bge\bet\bt_\b_p\bpn\bna\bam\bme\be(\b(p\bpn\bna\bam\bme\be)\b)
c\bch\bha\bar\br *\b*p\bpn\bna\bam\bme\be;\b;
t\btf\bf_\b_g\bge\bet\bt_\b_p\bpi\bin\bns\bst\bt(\b(p\bpi\bin\bns\bst\bt)\b)
c\bch\bha\bar\br *\b*p\bpi\bin\bns\bst\bt;\b;
t\btf\bf_\b_g\bge\bet\bt_\b_c\bcr\bre\bed\bd(\b(c\bc)\b)
C\bCR\bRE\bED\bDE\bEN\bNT\bTI\bIA\bAL\bLS\bS *\b*c\bc;\b;
t\btf\bf_\b_c\bcl\blo\bos\bse\be(\b()\b)
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
This group of routines are provided to manipulate the Ker-
beros tickets file. A ticket file has the following for-
mat:
principal's name (null-terminated string)
principal's instance (null-terminated string)
CREDENTIAL_1
CREDENTIAL_2
...
CREDENTIAL_n
EOF
Where "CREDENTIAL_x" consists of the following fixed-length
fields from the CREDENTIALS structure (defined in <kerberosIV/krb.h>):
char service[ANAME_SZ]
char instance[INST_SZ]
char realm[REALM_SZ]
des_cblock session
int lifetime
int kvno
KTEXT_ST ticket_st
long issue_date
MIT Project Athena Kerberos Version 4.0 1
TF_UTIL(3) BSD Programmer's Manual TF_UTIL(3)
_\bt_\bf_\b__\bi_\bn_\bi_\bt must be called before the other ticket file rou-
tines. It takes the name of the ticket file to use, and a
read/write flag as arguments. It tries to open the ticket
file, checks the mode and if everything is okay, locks the
file. If it's opened for reading, the lock is shared. If
it's opened for writing, the lock is exclusive. KSUCCESS
is returned if all went well, otherwise one of the follow-
ing:
NO_TKT_FIL - file wasn't there
TKT_FIL_ACC - file was in wrong mode, etc.
TKT_FIL_LCK - couldn't lock the file, even after a retry
The _\bt_\bf_\b__\bg_\be_\bt_\b__\bp_\bn_\ba_\bm_\be reads the principal's name from a ticket
file. It should only be called after tf_init has been
called. The principal's name is filled into the _\bp_\bn_\ba_\bm_\be
parameter. If all goes well, KSUCCESS is returned. If
tf_init wasn't called, TKT_FIL_INI is returned. If the
principal's name was null, or EOF was encountered, or the
name was longer than ANAME_SZ, TKT_FIL_FMT is returned.
The _\bt_\bf_\b__\bg_\be_\bt_\b__\bp_\bi_\bn_\bs_\bt reads the principal's instance from a
ticket file. It should only be called after tf_init and
tf_get_pname have been called. The principal's instance
is filled into the _\bp_\bi_\bn_\bs_\bt parameter. If all goes well,
KSUCCESS is returned. If tf_init wasn't called,
TKT_FIL_INI is returned. If EOF was encountered, or the
name was longer than INST_SZ, TKT_FIL_FMT is returned.
Note that, unlike the principal name, the instance name
may be null.
The _\bt_\bf_\b__\bg_\be_\bt_\b__\bc_\br_\be_\bd routine reads a CREDENTIALS record from a
ticket file and fills in the given structure. It should
only be called after tf_init, tf_get_pname, and
tf_get_pinst have been called. If all goes well, KSUCCESS
is returned. Possible error codes are:
TKT_FIL_INI - tf_init wasn't called first
TKT_FIL_FMT - bad format
EOF - end of file encountered
_\bt_\bf_\b__\bc_\bl_\bo_\bs_\be closes the ticket file and releases the lock on
it.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
krb(3)
D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
MIT Project Athena Kerberos Version 4.0 2
TF_UTIL(3) BSD Programmer's Manual TF_UTIL(3)
B\bBU\bUG\bGS\bS
The ticket file routines have to be called in a certain
order.
A\bAU\bUT\bTH\bHO\bOR\bRS\bS
Jennifer Steiner, MIT Project Athena
Bill Bryant, MIT Project Athena
R\bRE\bES\bST\bTR\bRI\bIC\bCT\bTI\bIO\bON\bNS\bS
Copyright 1987 Massachusetts Institute of Technology
MIT Project Athena Kerberos Version 4.0 3