summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-10-09 19:02:22 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-10-12 09:56:54 +0200
commite7a24374d97e1d1c32d3e18561a20e8c5e6319ec (patch)
tree7acc2bb1d30f9e3cc72b500a5810ae4e48748743 /src/providers/krb5
parent115cc768599d7df4b3206426652d3e7a3971d597 (diff)
downloadsssd-e7a24374d97e1d1c32d3e18561a20e8c5e6319ec.tar.gz
sssd-e7a24374d97e1d1c32d3e18561a20e8c5e6319ec.tar.xz
sssd-e7a24374d97e1d1c32d3e18561a20e8c5e6319ec.zip
Collect krb5 trace on high debug levels
If the debug level contains SSSDBG_TRACE_ALL, then the logs would also include tracing information from libkrb5. https://fedorahosted.org/sssd/ticket/1539
Diffstat (limited to 'src/providers/krb5')
-rw-r--r--src/providers/krb5/krb5_child.c25
-rw-r--r--src/providers/krb5/krb5_init_shared.c2
2 files changed, 25 insertions, 2 deletions
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index 0116dbb70..cd826add0 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -1616,6 +1616,25 @@ done:
return kerr;
}
+static errno_t
+set_child_debugging(krb5_context ctx)
+{
+ krb5_error_code kerr;
+
+ /* Set the global error context */
+ krb5_error_ctx = ctx;
+
+ if (debug_level & SSSDBG_TRACE_ALL) {
+ kerr = krb5_set_trace_callback(ctx, sss_child_krb5_trace_cb, NULL);
+ if (kerr) {
+ KRB5_CHILD_DEBUG(SSSDBG_MINOR_FAILURE, kerr);
+ return EIO;
+ }
+ }
+
+ return EOK;
+}
+
static int krb5_child_setup(struct krb5_req *kr, uint32_t offline)
{
krb5_error_code kerr = 0;
@@ -1682,7 +1701,11 @@ static int krb5_child_setup(struct krb5_req *kr, uint32_t offline)
KRB5_CHILD_DEBUG(SSSDBG_CRIT_FAILURE, kerr);
goto failed;
}
- krb5_error_ctx = kr->ctx;
+
+ kerr = set_child_debugging(kr->ctx);
+ if (kerr != EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE, ("Cannot set krb5_child debugging\n"));
+ }
kerr = krb5_parse_name(kr->ctx, kr->upn, &kr->princ);
if (kerr != 0) {
diff --git a/src/providers/krb5/krb5_init_shared.c b/src/providers/krb5/krb5_init_shared.c
index 7a0149184..312c695ea 100644
--- a/src/providers/krb5/krb5_init_shared.c
+++ b/src/providers/krb5/krb5_init_shared.c
@@ -71,7 +71,7 @@ errno_t krb5_child_init(struct krb5_ctx *krb5_auth_ctx,
}
if (debug_to_file != 0) {
- ret = open_debug_file_ex("krb5_child", &debug_filep);
+ ret = open_debug_file_ex(KRB5_CHILD_LOG_FILE, &debug_filep);
if (ret != EOK) {
DEBUG(0, ("Error setting up logging (%d) [%s]\n",
ret, strerror(ret)));