- ret = krb5_cc_store_cred(context, ccache, &creds);
- if (ret) {
- log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
- "krb5_cc_store_cred() failed: %s",
- krb5_get_err_text(context, ret));
- goto end;
- }
+ ret = krb5_cc_initialize(context, ret_ccache, principal);
+ if (ret) {
+ log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "krb5_cc_initialize() failed: %s",
+ krb5_get_err_text(context, ret));
+ goto end;
+ }
+
+ ret = krb5_cc_store_cred(context, ret_ccache, &creds);
+ if (ret) {
+ log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "krb5_cc_store_cred() failed: %s",
+ krb5_get_err_text(context, ret));
+ goto end;