From 924f7b919023f744cdcbb30c4df5b67b7a912e91 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 10 Apr 2016 16:25:04 -0500 Subject: [PATCH] lib/krb5: Windows API:krb5cc ccache fallback If there is no MSLSA: credential cache principal, then try to fallback to the MIT default MIT credential cache name, API:krb5cc. Change-Id: I8f981c5401b4f962cf808e7b0dc782e42bc03023 --- lib/krb5/cache.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/krb5/cache.c b/lib/krb5/cache.c index 0d028b3fd..c4a7fbda8 100644 --- a/lib/krb5/cache.c +++ b/lib/krb5/cache.c @@ -574,6 +574,17 @@ krb5_cc_set_default_name(krb5_context context, const char *name) krb5_cc_close(context, id); } } + if (p == NULL) { + /* + * If the API:krb5cc ccache can be resolved, + * use it as the default. + */ + krb5_ccache api_id; + ret = krb5_cc_resolve(context, "API:krb5cc", &api_id); + if (ret == 0) + krb5_cc_close(context, api_id); + } + /* Otherwise, fallback to the FILE ccache */ #endif if (p == NULL) { ret = (*ops->get_default_name)(context, &p);