|
|
1.1 ! root 1: .\" $Source: /usr/src/kerberosIV/man/RCS/tf_util.3,v $ ! 2: .\" $Author: kfall $ ! 3: .\" $Header: /usr/src/kerberosIV/man/RCS/tf_util.3,v 4.3 90/06/25 21:12:43 kfall Exp $ ! 4: .\" Copyright 1989 by the Massachusetts Institute of Technology. ! 5: .\" ! 6: .\" For copying and distribution information, ! 7: .\" please see the file <mit-copyright.h>. ! 8: .\" ! 9: .TH TF_UTIL 3 "Kerberos Version 4.0" "MIT Project Athena" ! 10: .SH NAME ! 11: tf_init, tf_get_pname, tf_get_pinst, tf_get_cred, tf_close \ ! 12: \- Routines for manipulating a Kerberos ticket file ! 13: .SH SYNOPSIS ! 14: .nf ! 15: .nj ! 16: .ft B ! 17: #include <kerberosIV/krb.h> ! 18: .PP ! 19: .ft B ! 20: extern char *krb_err_txt[]; ! 21: .PP ! 22: .ft B ! 23: tf_init(tf_name, rw) ! 24: char *tf_name; ! 25: int rw; ! 26: .PP ! 27: .ft B ! 28: tf_get_pname(pname) ! 29: char *pname; ! 30: .PP ! 31: .ft B ! 32: tf_get_pinst(pinst) ! 33: char *pinst; ! 34: .PP ! 35: .ft B ! 36: tf_get_cred(c) ! 37: CREDENTIALS *c; ! 38: .PP ! 39: .ft B ! 40: tf_close() ! 41: .PP ! 42: .fi ! 43: .SH DESCRIPTION ! 44: This group of routines are provided to manipulate the Kerberos tickets ! 45: file. A ticket file has the following format: ! 46: .nf ! 47: .in +4 ! 48: .sp ! 49: principal's name (null-terminated string) ! 50: principal's instance (null-terminated string) ! 51: CREDENTIAL_1 ! 52: CREDENTIAL_2 ! 53: ... ! 54: CREDENTIAL_n ! 55: EOF ! 56: .sp ! 57: .in -4 ! 58: .LP ! 59: Where "CREDENTIAL_x" consists of the following fixed-length ! 60: fields from the CREDENTIALS structure (defined in <kerberosIV/krb.h>): ! 61: .nf ! 62: .sp ! 63: .in +4 ! 64: char service[ANAME_SZ] ! 65: char instance[INST_SZ] ! 66: char realm[REALM_SZ] ! 67: des_cblock session ! 68: int lifetime ! 69: int kvno ! 70: KTEXT_ST ticket_st ! 71: long issue_date ! 72: .in -4 ! 73: .sp ! 74: .fi ! 75: .PP ! 76: .I tf_init ! 77: must be called before the other ticket file ! 78: routines. ! 79: It takes the name of the ticket file to use, ! 80: and a read/write flag as arguments. ! 81: It tries to open the ticket file, checks the mode and if ! 82: everything is okay, locks the file. If it's opened for ! 83: reading, the lock is shared. If it's opened for writing, ! 84: the lock is exclusive. ! 85: KSUCCESS is returned if all went well, otherwise one of the ! 86: following: ! 87: .nf ! 88: .sp ! 89: NO_TKT_FIL - file wasn't there ! 90: TKT_FIL_ACC - file was in wrong mode, etc. ! 91: TKT_FIL_LCK - couldn't lock the file, even after a retry ! 92: .sp ! 93: .fi ! 94: .PP ! 95: The ! 96: .I tf_get_pname ! 97: reads the principal's name from a ticket file. ! 98: It should only be called after tf_init has been called. The ! 99: principal's name is filled into the ! 100: .I pname ! 101: parameter. If all goes ! 102: well, KSUCCESS is returned. ! 103: If tf_init wasn't called, TKT_FIL_INI ! 104: is returned. ! 105: If the principal's name was null, or EOF was encountered, or the ! 106: name was longer than ANAME_SZ, TKT_FIL_FMT is returned. ! 107: .PP ! 108: The ! 109: .I tf_get_pinst ! 110: reads the principal's instance from a ticket file. ! 111: It should only be called after tf_init and tf_get_pname ! 112: have been called. ! 113: The principal's instance is filled into the ! 114: .I pinst ! 115: parameter. ! 116: If all goes ! 117: well, KSUCCESS is returned. ! 118: If tf_init wasn't called, TKT_FIL_INI ! 119: is returned. ! 120: If EOF was encountered, or the ! 121: name was longer than INST_SZ, TKT_FIL_FMT is returned. ! 122: Note that, unlike the principal name, the instance name may be null. ! 123: .PP ! 124: The ! 125: .I tf_get_cred ! 126: routine reads a CREDENTIALS record from a ticket file and ! 127: fills in the given structure. ! 128: It should only be called after ! 129: tf_init, tf_get_pname, and tf_get_pinst have been called. ! 130: If all goes well, KSUCCESS is returned. Possible error codes ! 131: are: ! 132: .nf ! 133: .sp ! 134: TKT_FIL_INI - tf_init wasn't called first ! 135: TKT_FIL_FMT - bad format ! 136: EOF - end of file encountered ! 137: .sp ! 138: .fi ! 139: .PP ! 140: .I tf_close ! 141: closes the ticket file and releases the lock on it. ! 142: .SH "SEE ALSO" ! 143: krb(3) ! 144: .SH DIAGNOSTICS ! 145: .SH BUGS ! 146: The ticket file routines have to be called in a certain order. ! 147: .SH AUTHORS ! 148: Jennifer Steiner, MIT Project Athena ! 149: .br ! 150: Bill Bryant, MIT Project Athena ! 151: .SH RESTRICTIONS ! 152: Copyright 1987 Massachusetts Institute of Technology
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.