RCSID("$Header$");
-extern char *whoami;
-
-/* too bad we can't set the pathname easily */
static char *srvtab = KEYFILE; /* default == /etc/srvtab */
static char realm[REALM_SZ];
static char master[INST_SZ] = "sms";
static char service[ANAME_SZ] = "rcmd";
-C_Block session;
-
-int get_mr_tgt(void);
-
-static void init(void)
-{
- static int initialized = 0;
-
- if (!initialized)
- {
- if (krb_get_lrealm(realm, 1))
- strcpy(realm, KRB_REALM);
- initialize_krb_error_table();
- initialized = 1;
- }
-}
+des_cblock session;
+static int get_mr_tgt(void);
int get_mr_update_ticket(char *host, KTEXT ticket)
{
- int code;
- int pass;
+ int code, pass;
char phost[BUFSIZ];
CREDENTIALS cr;
pass = 1;
- init();
+ if (krb_get_lrealm(realm, 1))
+ strcpy(realm, KRB_REALM);
strcpy(phost, (char *)krb_get_phost(host));
+
try_it:
code = krb_mk_req(ticket, service, phost, realm, (long)0);
if (code)
return code;
}
-int get_mr_tgt(void)
+static int get_mr_tgt(void)
{
int code;
char linst[INST_SZ], kinst[INST_SZ];
- init();
linst[0] = '\0';
strcpy(kinst, "krbtgt");
code = krb_get_svc_in_tkt(master, linst, realm, kinst, realm,