]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Use cc_user_set_default_name to 'make default'
authorKevin Wasserman <kevin.wasserman@painless-security.com>
Tue, 17 Jul 2012 17:51:46 +0000 (13:51 -0400)
committerTom Yu <tlyu@mit.edu>
Wed, 29 Aug 2012 20:28:16 +0000 (16:28 -0400)
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 <kevin.wasserman@painless-security.com>
(cherry picked from commit 84b0d77e7d9d8f4a733bc0d71afb7815584d1c12)

ticket: 7303
status: resolved

src/windows/leash/LeashView.cpp

index 7b5ba17d28929d68fbc34a115d4fa00b0c4e0bd7..881d5c16fa4308a9296c2b261016b48b61243ce0 100644 (file)
@@ -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;