{
krb5_creds ** creds = NULL;
krb5_error_code retval;
- krb5_ccache template_ccache = NULL;
krb5_ccache ccache = NULL;
krb5_gss_cred_id_t cred = NULL;
krb5_auth_context new_auth_ctx = NULL;
goto cleanup;
}
- /* Lots of kludging going on here... Some day the ccache interface
- will be rewritten though */
-
- if ((retval = krb5_cc_resolve(context, "MEMORY:GSSAPI", &template_ccache)))
- goto cleanup;
-
- ccache = template_ccache; /* krb5_cc_gen_new will replace so make a copy */
- if ((retval = krb5_cc_gen_new(context, &ccache))) {
+ if ((retval = krb5_cc_new_unique(context, "MEMORY", NULL, &ccache))) {
ccache = NULL;
goto cleanup;
}
-
+
if ((retval = krb5_cc_initialize(context, ccache, creds[0]->client)))
goto cleanup;
if (creds)
krb5_free_tgt_creds(context, creds);
- if (template_ccache)
- (void)krb5_cc_close(context, template_ccache);
-
if (ccache)
(void)krb5_cc_destroy(context, ccache);
krb5_error_code ret;
krb5_principal server;
krb5_keytab keytab;
- krb5_ccache template_ccache;
krb5_ccache ccache;
krb5_keytab_entry kte;
krb5_creds in_creds, *out_creds;
server = NULL;
keytab = NULL;
- template_ccache = NULL;
ccache = NULL;
out_creds = NULL;
authcon = NULL;
internals with a coherent idea of "in" and "out". */
/* insert the initial cred into the ccache */
-
- if ((ret = krb5_cc_resolve(context, "MEMORY:rd_req", &template_ccache)))
- goto cleanup;
- ccache = template_ccache; /* krb5_cc_gen_new will replace so make a copy */
- if ((ret = krb5_cc_gen_new(context, &ccache))) {
+
+ if ((ret = krb5_cc_new_unique(context, "MEMORY", NULL, &ccache))) {
ccache = NULL;
goto cleanup;
}
-
+
if ((ret = krb5_cc_initialize(context, ccache, creds->client)))
goto cleanup;
krb5_free_principal(context, server);
if (!keytab_arg && keytab)
krb5_kt_close(context, keytab);
- if (template_ccache)
- krb5_cc_close(context, template_ccache);
if (ccache)
krb5_cc_destroy(context, ccache);
if (out_creds)