#include <stdio.h>
#include <string.h>
+#ifdef HAVE_KRB4
#include <krb.h>
+#else
+#define KTEXT void*
+#endif
+#include <krb5.h>
#include <update.h>
RCSID("$Header$");
+#ifdef HAVE_KRB4
static char realm[REALM_SZ];
static char master[INST_SZ] = "sms";
static char service[ANAME_SZ] = "rcmd";
des_cblock session;
+#endif
+krb5_context context = NULL;
+#ifdef HAVE_KRB4
static int get_mr_tgt(void);
+#endif
+
+int get_mr_krb5_update_ticket(char *host, krb5_data auth)
+{
+ krb5_auth_context auth_con = NULL;
+ krb5_ccache ccache = NULL;
+ krb5_error_code code;
+
+ code = krb5_init_context(&context);
+ if (code)
+ goto out;
+
+ code = krb5_auth_con_init(context, &auth_con);
+ if (code)
+ goto out;
+
+ code = krb5_cc_default(context, &ccache);
+ if (code)
+ goto out;
+
+ code = krb5_mk_req(context, &auth_con, 0, "host", host, NULL, ccache,
+ &auth);
+
+ out:
+ if (ccache)
+ krb5_cc_close(context, ccache);
+ if (auth_con)
+ krb5_auth_con_free(context, auth_con);
+ return code;
+}
int get_mr_update_ticket(char *host, KTEXT ticket)
{
+#ifdef HAVE_KRB4
int code, pass;
char phost[BUFSIZ];
CREDENTIALS cr;
memcpy(session, cr.session, sizeof(session));
}
return code;
+#else
+ return MR_NO_KRB4;
+#endif
}
+#ifdef HAVE_KRB4
static int get_mr_tgt(void)
{
int code;
else
return code + ERROR_TABLE_BASE_krb;
}
+#endif