From: Jeffrey Altman Date: Tue, 25 Sep 2007 03:16:18 +0000 (+0000) Subject: More consolidation of the computation of the default ccache name X-Git-Tag: krb5-1.7-alpha1~858 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dfead171781062695dc190a235453d844d0f331b;p=krb5.git More consolidation of the computation of the default ccache name ticket: 5691 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19974 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/windows/identity/plugins/krb5/krb5identpro.c b/src/windows/identity/plugins/krb5/krb5identpro.c index 6f7ee3082..996918351 100644 --- a/src/windows/identity/plugins/krb5/krb5identpro.c +++ b/src/windows/identity/plugins/krb5/krb5identpro.c @@ -830,41 +830,14 @@ k5_ident_set_default_int(khm_handle def_ident) { cb = sizeof(id_ccname); if (KHM_FAILED(kcdb_identity_get_attr(def_ident, attr_id_krb5_ccname, NULL, id_ccname, &cb))) { - khm_handle csp_ident = NULL; - khm_handle csp_k5 = NULL; - _reportf(L"The specified identity does not have the Krb5CCName property"); cb = sizeof(id_ccname); - if (KHM_SUCCEEDED(kcdb_identity_get_config(def_ident, 0, &csp_ident)) && - KHM_SUCCEEDED(khc_open_space(csp_ident, CSNAME_KRB5CRED, 0, &csp_k5)) && - KHM_SUCCEEDED(khc_read_string(csp_k5, L"DefaultCCName", - id_ccname, &cb))) { - - _reportf(L"Found CC name in configuration [%s]", id_ccname); - } else { - /* last resort, use the name of the identity as the cc - name */ - cb = sizeof(id_ccname); - if (KHM_FAILED(kcdb_identity_get_name(def_ident, id_ccname, &cb))) { - _reportf(L"Can't use name of identity as CCName"); - _end_task(); - - id_ccname[0] = L'\0'; - } - } - - if (csp_k5) - khc_close_space(csp_k5); - if (csp_ident) - khc_close_space(csp_ident); - - if (id_ccname[0] == L'\0') + if (KHM_FAILED(khm_krb5_get_identity_default_ccache(def_ident, id_ccname, &cb))) { return KHM_ERROR_INVALID_PARAM; + } } - khm_krb5_canon_cc_name(id_ccname, sizeof(id_ccname)); - _reportf(L"Found Krb5CCName property : %s", id_ccname); StringCbLength(id_ccname, sizeof(id_ccname), &cb);