From 4811057a37549a6ef3a2b04f8bcce8b64d44f581 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 28 Nov 2012 14:16:52 +0100 Subject: Enable libldap debugging --- src/providers/ldap/sdap_async_connection.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/providers/ldap/sdap_async_connection.c') diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c index 20f282e3d..0dfcfc637 100644 --- a/src/providers/ldap/sdap_async_connection.c +++ b/src/providers/ldap/sdap_async_connection.c @@ -70,6 +70,7 @@ struct sdap_connect_state { struct sdap_msg *reply; int result; + int old_ldap_debug; }; static void sdap_sys_connect_done(struct tevent_req *subreq); @@ -129,6 +130,13 @@ struct tevent_req *sdap_connect_send(TALLOC_CTX *memctx, goto fail; } + ret = sss_ldap_set_debug(&state->old_ldap_debug); + if (ret != EOK) { + DEBUG(SSSDBG_MINOR_FAILURE, + ("Could not set extra LDAP debugging\n")); + /* Not fatal, carry on */ + } + tevent_req_set_callback(subreq, sdap_sys_connect_done, req); return req; @@ -425,6 +433,8 @@ int sdap_connect_recv(struct tevent_req *req, struct sdap_connect_state *state = tevent_req_data(req, struct sdap_connect_state); + sss_ldap_reset_debug(state->old_ldap_debug); + TEVENT_REQ_RETURN_ON_ERROR(req); *sh = talloc_steal(memctx, state->sh); -- cgit