krb5_cc_cursor cursor = NULL;
krb5_principal princ = NULL;
krb5_error_code code;
- char *dummy_name;
uint32_t maj_stat = GSS_S_FAILURE;
- dummy_name = talloc_asprintf(ccc,
- "MEMORY:gss_krb5_copy_ccache-%p",
- &ccc->ccache);
- if (dummy_name == NULL) {
- *min_stat = ENOMEM;
- return GSS_S_FAILURE;
- }
-
/*
* Create a dummy ccache, so we can iterate over the credentials
* and find the default principal for the ccache we want to
* copy. The new ccache needs to be initialized with this
* principal.
*/
- code = krb5_cc_resolve(context, dummy_name, &dummy_ccache);
- TALLOC_FREE(dummy_name);
+ code = smb_krb5_cc_new_unique_memory(context, NULL, NULL, &dummy_ccache);
if (code != 0) {
*min_stat = code;
return GSS_S_FAILURE;