From 8ff9a9309366fa61f831d0d6bcd59396d4445e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 3 Dec 2007 17:17:41 +0000 Subject: [PATCH] Use krb5_cc_ops->default_name to get the default name. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22104 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/cache.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/krb5/cache.c b/lib/krb5/cache.c index 72ad49721..f140b0520 100644 --- a/lib/krb5/cache.c +++ b/lib/krb5/cache.c @@ -209,18 +209,7 @@ krb5_error_code KRB5_LIB_FUNCTION krb5_cc_new_unique(krb5_context context, const char *type, const char *hint, krb5_ccache *id) { - const krb5_cc_ops *ops; - - if (type == NULL) - type = KRB5_DEFAULT_CCNAME; - - ops = krb5_cc_get_prefix_ops(context, type); - if (ops == NULL) { - krb5_set_error_string(context, "Credential cache type %s is unknown", - type); - return KRB5_CC_UNKNOWN_TYPE; - } - + const krb5_cc_ops *ops = KRB5_DEFAULT_CCTYPE; return krb5_cc_gen_new(context, ops, id); } @@ -431,11 +420,17 @@ krb5_cc_set_default_name(krb5_context context, const char *name) if (e == NULL) { e = krb5_config_get_string(context, NULL, "libdefaults", "default_cc_name", NULL); - if (e == NULL) - e = KRB5_DEFAULT_CCNAME; - ret = _krb5_expand_default_cc_name(context, e, &p); - if (ret) - return ret; + if (e) { + ret = _krb5_expand_default_cc_name(context, e, &p); + if (ret) + return ret; + } + if (e == NULL) { + const krb5_cc_ops *ops = KRB5_DEFAULT_CCTYPE; + ret = (*ops->default_name)(context, &p); + if (ret) + return ret; + } } } else p = strdup(name);