From: Kevin Wasserman Date: Tue, 17 Jul 2012 17:51:46 +0000 (-0400) Subject: Use cc_user_set_default_name to 'make default' X-Git-Tag: kfw-4.0-final~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18e78b112c589ce16361c7214bc61f275079c636;p=thirdparty%2Fkrb5.git Use cc_user_set_default_name to 'make default' In addition to calling krb5_cc_switch(), use krb5int_cc_user_set_default_name() in CLeashView::OnMakeDefault() to set the default ccache for all processes for the current user. Signed-off-by: Kevin Wasserman (cherry picked from commit 84b0d77e7d9d8f4a733bc0d71afb7815584d1c12) ticket: 7303 status: resolved --- diff --git a/src/windows/leash/LeashView.cpp b/src/windows/leash/LeashView.cpp index 7b5ba17d28..881d5c16fa 100644 --- a/src/windows/leash/LeashView.cpp +++ b/src/windows/leash/LeashView.cpp @@ -1016,6 +1016,14 @@ VOID CLeashView::OnMakeDefault() code = pkrb5_cc_resolve(ctx, elem->m_ccacheName, &cc); if (!code) code = pkrb5_cc_switch(ctx, cc); + if (!code) { + const char *cctype = pkrb5_cc_get_type(ctx, cc); + if (cctype != NULL) { + char defname[20]; + sprintf_s(defname, "%s:", cctype); + code = pkrb5int_cc_user_set_default_name(ctx, defname); + } + } pkrb5_free_context(ctx); CLeashApp::m_bUpdateDisplay = TRUE; break;