From de830a6c4b032ec21c2aad9f7b56fd80fe09817b Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Mon, 20 Oct 2014 17:09:34 +0200 Subject: [PATCH 12/22] ipa: improve error reporting for extdom LDAP exop This patch fixes a typo when calling ldap_parse_result() which prevented the server-side error message to be used and adds a hint that more information might be available on the server side. Fixes: https://fedorahosted.org/sssd/ticket/2456 Reviewed-by: Jakub Hrozek --- src/providers/ipa/ipa_s2n_exop.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c index 96528816a520b633f1f1caa975dee9b9515621c3..bd5c00b6a48018f8f904aaa03e8162425651b37a 100644 --- a/src/providers/ipa/ipa_s2n_exop.c +++ b/src/providers/ipa/ipa_s2n_exop.c @@ -133,7 +133,7 @@ static void ipa_s2n_exop_done(struct sdap_op *op, } ret = ldap_parse_result(state->sh->ldap, reply->msg, - &result, &errmsg, NULL, NULL, + &result, NULL, &errmsg, NULL, NULL, 0); if (ret != LDAP_SUCCESS) { DEBUG(SSSDBG_OP_FAILURE, "ldap_parse_result failed (%d)\n", @@ -142,10 +142,13 @@ static void ipa_s2n_exop_done(struct sdap_op *op, goto done; } - DEBUG(SSSDBG_TRACE_FUNC, "ldap_extended_operation result: %s(%d), %s\n", - sss_ldap_err2string(result), result, errmsg); + DEBUG(result == LDAP_SUCCESS ? SSSDBG_TRACE_FUNC : SSSDBG_OP_FAILURE, + "ldap_extended_operation result: %s(%d), %s.\n", + sss_ldap_err2string(result), result, errmsg); if (result != LDAP_SUCCESS) { + DEBUG(SSSDBG_OP_FAILURE, "ldap_extended_operation failed, " \ + "server logs might contain more details.\n"); ret = ERR_NETWORK_IO; goto done; } -- 1.9.3