{
krb5_error_code ret;
const struct ccache_container *old_ccc = NULL;
+ enum credentials_obtained old_obtained;
struct ccache_container *ccc = NULL;
char *ccache_name = NULL;
krb5_principal princ;
+ old_obtained = cred->ccache_obtained;
old_ccc = cred->ccache;
if (old_ccc == NULL) {
return 0;
}
+ cred->ccache = NULL;
+ cred->ccache_obtained = CRED_UNINITIALISED;
+ cred->client_gss_creds = NULL;
+ cred->client_gss_creds_obtained = CRED_UNINITIALISED;
+
ret = krb5_cc_get_principal(
old_ccc->smb_krb5_context->krb5_context,
old_ccc->ccache,
/*
* This is an empty ccache. No point in copying anything.
*/
- cred->ccache = NULL;
return 0;
}
krb5_free_principal(old_ccc->smb_krb5_context->krb5_context, princ);
}
cred->ccache = ccc;
- cred->client_gss_creds = NULL;
- cred->client_gss_creds_obtained = CRED_UNINITIALISED;
+ cred->ccache_obtained = old_obtained;
return ret;
}