summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-10-12 18:19:06 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-10-12 20:49:24 +0200
commitc5e4d4e9a3f6896f0f3c631ea26bb49a79b5cd8e (patch)
tree551c5496f05292b08fd840f286a24197dad7bcce /src
parentd78cb9cc9dbda1594b1a8f800c4ca865706d8e75 (diff)
downloadsssd-c5e4d4e9a3f6896f0f3c631ea26bb49a79b5cd8e.tar.gz
sssd-c5e4d4e9a3f6896f0f3c631ea26bb49a79b5cd8e.tar.bz2
sssd-c5e4d4e9a3f6896f0f3c631ea26bb49a79b5cd8e.zip
Only call krb5_set_trace_callback on platforms that support it
Diffstat (limited to 'src')
-rw-r--r--src/external/krb5.m41
-rw-r--r--src/providers/krb5/krb5_child.c2
-rw-r--r--src/providers/ldap/ldap_child.c2
-rw-r--r--src/util/sss_krb5.c17
-rw-r--r--src/util/sss_krb5.h5
5 files changed, 21 insertions, 6 deletions
diff --git a/src/external/krb5.m4 b/src/external/krb5.m4
index 474cb37c..cb420aae 100644
--- a/src/external/krb5.m4
+++ b/src/external/krb5.m4
@@ -59,6 +59,7 @@ AC_CHECK_FUNCS([krb5_get_init_creds_opt_alloc krb5_get_error_message \
krb5_principal_get_realm \
krb5_cc_cache_match \
krb5_timestamp_to_sfstring \
+ krb5_set_trace_callback \
krb5_cc_get_full_name])
CFLAGS=$SAVE_CFLAGS
LIBS=$SAVE_LIBS
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index cd826add..a92ba57b 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -1625,7 +1625,7 @@ set_child_debugging(krb5_context ctx)
krb5_error_ctx = ctx;
if (debug_level & SSSDBG_TRACE_ALL) {
- kerr = krb5_set_trace_callback(ctx, sss_child_krb5_trace_cb, NULL);
+ kerr = sss_child_set_krb5_tracing(ctx);
if (kerr) {
KRB5_CHILD_DEBUG(SSSDBG_MINOR_FAILURE, kerr);
return EIO;
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
index de25fc07..e0529dbc 100644
--- a/src/providers/ldap/ldap_child.c
+++ b/src/providers/ldap/ldap_child.c
@@ -150,7 +150,7 @@ set_child_debugging(krb5_context ctx)
krb5_error_ctx = ctx;
if (debug_level & SSSDBG_TRACE_ALL) {
- kerr = krb5_set_trace_callback(ctx, sss_child_krb5_trace_cb, NULL);
+ kerr = sss_child_set_krb5_tracing(ctx);
if (kerr) {
LDAP_CHILD_DEBUG(SSSDBG_MINOR_FAILURE, kerr);
return EIO;
diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c
index 0a80f23a..c36a1374 100644
--- a/src/util/sss_krb5.c
+++ b/src/util/sss_krb5.c
@@ -964,7 +964,8 @@ sss_krb5_residual_check_type(const char *full_location,
return sss_krb5_residual_by_type(full_location, type);
}
-void
+#ifdef HAVE_KRB5_SET_TRACE_CALLBACK
+static void
sss_child_krb5_trace_cb(krb5_context context,
const struct krb5_trace_info *info, void *data)
{
@@ -975,3 +976,17 @@ sss_child_krb5_trace_cb(krb5_context context,
DEBUG(SSSDBG_TRACE_ALL, ("%s\n", info->message));
}
+
+errno_t
+sss_child_set_krb5_tracing(krb5_context ctx)
+{
+ return krb5_set_trace_callback(ctx, sss_child_krb5_trace_cb, NULL);
+}
+#else /* HAVE_KRB5_SET_TRACE_CALLBACK */
+errno_t
+sss_child_set_krb5_tracing(krb5_context ctx)
+{
+ DEBUG(SSSDBG_CONF_SETTINGS, ("krb5 tracing is not available\n"));
+ return 0;
+}
+#endif /* HAVE_KRB5_SET_TRACE_CALLBACK */
diff --git a/src/util/sss_krb5.h b/src/util/sss_krb5.h
index 708914c6..c16dab59 100644
--- a/src/util/sss_krb5.h
+++ b/src/util/sss_krb5.h
@@ -167,8 +167,7 @@ typedef krb5_ticket_times sss_krb5_ticket_times;
typedef krb5_times sss_krb5_ticket_times;
#endif
-void
-sss_child_krb5_trace_cb(krb5_context context,
- const struct krb5_trace_info *info, void *data);
+/* Redirect libkrb5 tracing towards our DEBUG statements */
+errno_t sss_child_set_krb5_tracing(krb5_context ctx);
#endif /* __SSS_KRB5_H__ */