5 /* (c) Copyright 1988 by the Massachusetts Institute of Technology. */
6 /* For copying and distribution information, please see the file */
7 /* <mit-copyright.h>. */
10 static char *rcsid_ticket_c = "$Header$";
13 #include <mit-copyright.h>
16 #include <sys/types.h>
23 /* too bad we can't set the pathname easily */
24 static char *srvtab = KEYFILE; /* default == /etc/srvtab */
25 static char realm[REALM_SZ];
26 static char master[INST_SZ] = "sms";
27 static char service[ANAME_SZ] = "rcmd";
33 static int initialized = 0;
36 if (krb_get_lrealm(realm, 1))
37 strcpy(realm, KRB_REALM);
38 initialize_krb_error_table();
45 get_mr_update_ticket(host, ticket)
56 strcpy(phost, krb_get_phost(host));
58 code = krb_mk_req(ticket, service, phost, realm, (long)0);
61 /* maybe we're taking too long? */
62 if ((code = get_mr_tgt()) != 0) {
63 com_err(whoami, code, " can't get Kerberos TGT");
69 com_err(whoami, code, "in krb_mk_req");
71 code = krb_get_cred(service, phost, realm, &cr);
72 bcopy(cr.session, session, sizeof(session));
81 char linst[INST_SZ], kinst[INST_SZ];
85 strcpy(kinst, "krbtgt");
86 code = krb_get_svc_in_tkt(master, linst, realm, kinst, realm, 1, srvtab);
90 return(code + ERROR_TABLE_BASE_krb);