[SSSD] [PATCH] ipa: improve error reporting for extdom LDAP exop

Sumit Bose sbose at redhat.com
Wed Oct 22 08:40:31 UTC 2014


Hi,

error reporting for the calls to the IPA extdom plugin is currently
quite poor. One of the reasons is a typo which let SSSD ignore the error
message string returned by the server. This patch fixes this and adds a
log message asking to check the server logs for more details in the case
of an error.

bye,
Sumit
-------------- next part --------------
From ef9e4c492252810d7f3f26c829768f7d49fc96dd Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Mon, 20 Oct 2014 17:09:34 +0200
Subject: [PATCH] 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
---
 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 9652881..bd5c00b 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.8.3.1



More information about the sssd-devel mailing list