Implement KRB5_TRACE using existing logging framework
This commit is contained in:

committed by
Jeffrey Altman

parent
15ae5f06a9
commit
fcd57af8e1
@@ -240,19 +240,26 @@ init_context_from_config_file(krb5_context context)
|
|||||||
context->default_cc_name = NULL;
|
context->default_cc_name = NULL;
|
||||||
context->default_cc_name_set = 0;
|
context->default_cc_name_set = 0;
|
||||||
|
|
||||||
|
tmp = secure_getenv("KRB5_TRACE");
|
||||||
s = krb5_config_get_strings(context, NULL, "logging", "krb5", NULL);
|
s = krb5_config_get_strings(context, NULL, "logging", "krb5", NULL);
|
||||||
if(s) {
|
if (tmp || s) {
|
||||||
char **p;
|
char **p;
|
||||||
|
|
||||||
if (context->debug_dest)
|
if (context->debug_dest)
|
||||||
krb5_closelog(context, context->debug_dest);
|
krb5_closelog(context, context->debug_dest);
|
||||||
|
|
||||||
krb5_initlog(context, "libkrb5", &context->debug_dest);
|
krb5_initlog(context, "libkrb5", &context->debug_dest);
|
||||||
|
|
||||||
|
if (s) {
|
||||||
for(p = s; *p; p++)
|
for(p = s; *p; p++)
|
||||||
krb5_addlog_dest(context, context->debug_dest, *p);
|
krb5_addlog_dest(context, context->debug_dest, *p);
|
||||||
krb5_config_free_strings(s);
|
krb5_config_free_strings(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tmp)
|
||||||
|
krb5_addlog_dest(context, context->debug_dest, tmp);
|
||||||
|
}
|
||||||
|
|
||||||
tmp = krb5_config_get_string(context, NULL, "libdefaults",
|
tmp = krb5_config_get_string(context, NULL, "libdefaults",
|
||||||
"check-rd-req-server", NULL);
|
"check-rd-req-server", NULL);
|
||||||
if (tmp == NULL)
|
if (tmp == NULL)
|
||||||
|
Reference in New Issue
Block a user