summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-06-25 15:15:56 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-07-02 16:06:52 -0400
commit5c9292bc86788f21274e1480acd2bbcc8a221b06 (patch)
treea91720724db0df029a84c5e457ac98bfb8cf641e
parenta71607420a44728e6aa237911da4221640a6a0e0 (diff)
downloadsssd-5c9292bc86788f21274e1480acd2bbcc8a221b06.tar.gz
sssd-5c9292bc86788f21274e1480acd2bbcc8a221b06.tar.xz
sssd-5c9292bc86788f21274e1480acd2bbcc8a221b06.zip
LDAP: Print extended failure message for SASL bind
-rw-r--r--src/providers/ldap/sdap_async_connection.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index efd9cd8cc..a0b5e2ba7 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -726,6 +726,8 @@ static struct tevent_req *sasl_bind_send(TALLOC_CTX *memctx,
struct tevent_req *req;
struct sasl_bind_state *state;
int ret = EOK;
+ int optret;
+ char *diag_msg = NULL;
req = tevent_req_create(memctx, &state, struct sasl_bind_state);
if (!req) return NULL;
@@ -748,8 +750,18 @@ static struct tevent_req *sasl_bind_send(TALLOC_CTX *memctx,
(*sdap_sasl_interact), state);
state->result = ret;
if (ret != LDAP_SUCCESS) {
- DEBUG(1, ("ldap_sasl_bind failed (%d)[%s]\n",
- ret, sss_ldap_err2string(ret)));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("ldap_sasl_bind failed (%d)[%s]\n",
+ ret, sss_ldap_err2string(ret)));
+
+ optret = sss_ldap_get_diagnostic_msg(state, state->sh->ldap,
+ &diag_msg);
+ if (optret == EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE,
+ ("Extended failure message: [%s]\n", diag_msg));
+ }
+ talloc_zfree(diag_msg);
+
goto fail;
}