lib/krb5: reformat krb5_cc_set_default_name

Remove unnecessary levels of indentation.

Switch the conditional from "(e == NULL)" to "(p == NULL)" since it
the variable 'p' that is actually used to store the name of the
default credential cache.

Change-Id: Id884e2cd80b42e47d3c219ac3777161087467a14
This commit is contained in:
Jeffrey Altman
2016-03-31 11:39:07 -05:00
parent eb1545382a
commit 338b4a1fba

View File

@@ -517,7 +517,7 @@ krb5_cc_set_default_name(krb5_context context, const char *name)
if (name == NULL) { if (name == NULL) {
const char *e = NULL; const char *e = NULL;
if(!issuid()) { if (!issuid()) {
e = getenv("KRB5CCNAME"); e = getenv("KRB5CCNAME");
if (e) { if (e) {
p = strdup(e); p = strdup(e);
@@ -528,11 +528,11 @@ krb5_cc_set_default_name(krb5_context context, const char *name)
} }
#ifdef _WIN32 #ifdef _WIN32
if (e == NULL) { if (p == NULL) {
e = p = _krb5_get_default_cc_name_from_registry(context); p = _krb5_get_default_cc_name_from_registry(context);
} }
#endif #endif
if (e == NULL) { if (p == NULL) {
e = krb5_config_get_string(context, NULL, "libdefaults", e = krb5_config_get_string(context, NULL, "libdefaults",
"default_cc_name", NULL); "default_cc_name", NULL);
if (e) { if (e) {
@@ -540,24 +540,24 @@ krb5_cc_set_default_name(krb5_context context, const char *name)
if (ret) if (ret)
return ret; return ret;
} }
if (e == NULL) { }
const krb5_cc_ops *ops = KRB5_DEFAULT_CCTYPE; if (p == NULL) {
e = krb5_config_get_string(context, NULL, "libdefaults", const krb5_cc_ops *ops = KRB5_DEFAULT_CCTYPE;
"default_cc_type", NULL); e = krb5_config_get_string(context, NULL, "libdefaults",
if (e) { "default_cc_type", NULL);
ops = krb5_cc_get_prefix_ops(context, e); if (e) {
if (ops == NULL) { ops = krb5_cc_get_prefix_ops(context, e);
krb5_set_error_message(context, if (ops == NULL) {
KRB5_CC_UNKNOWN_TYPE, krb5_set_error_message(context,
"Credential cache type %s " KRB5_CC_UNKNOWN_TYPE,
"is unknown", e); "Credential cache type %s "
return KRB5_CC_UNKNOWN_TYPE; "is unknown", e);
} return KRB5_CC_UNKNOWN_TYPE;
} }
ret = (*ops->get_default_name)(context, &p);
if (ret)
return ret;
} }
ret = (*ops->get_default_name)(context, &p);
if (ret)
return ret;
} }
context->default_cc_name_set = 0; context->default_cc_name_set = 0;
} else { } else {