summaryrefslogtreecommitdiff
path: root/src/providers/ldap/sdap_async.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-07-02 08:14:58 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-07-09 15:00:57 -0400
commit2ee34809cb2d580ac7a3e1fd666b005543e3aa8d (patch)
tree93a09887d8589a1582e3c6f624ca8f4dcc241ae0 /src/providers/ldap/sdap_async.c
parent8571644422d36fac63d2e351936433f1fb8856c7 (diff)
downloadsssd-2ee34809cb2d580ac7a3e1fd666b005543e3aa8d.tar.gz
sssd-2ee34809cb2d580ac7a3e1fd666b005543e3aa8d.tar.bz2
sssd-2ee34809cb2d580ac7a3e1fd666b005543e3aa8d.zip
Log TLS errors to syslog
Also adds support for detecting LDAPS errors by adding a check for SDAP_DIAGNOSTIC_MESSAGE after ldap_search_ext()
Diffstat (limited to 'src/providers/ldap/sdap_async.c')
-rw-r--r--src/providers/ldap/sdap_async.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index 77b7b5e1..0f260242 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -764,7 +764,9 @@ struct tevent_req *sdap_get_generic_send(TALLOC_CTX *memctx,
{
struct tevent_req *req = NULL;
struct sdap_get_generic_state *state = NULL;
+ char *errmsg;
int lret;
+ int optret;
int ret;
int msgid;
@@ -805,7 +807,21 @@ struct tevent_req *sdap_get_generic_send(TALLOC_CTX *memctx,
DEBUG(3, ("ldap_search_ext failed: %s\n", ldap_err2string(lret)));
if (lret == LDAP_SERVER_DOWN) {
ret = ETIMEDOUT;
- } else {
+ optret = ldap_get_option(state->sh->ldap,
+ SDAP_DIAGNOSTIC_MESSAGE,
+ (void*)&errmsg);
+ if (optret == LDAP_SUCCESS) {
+ DEBUG(3, ("Connection error: %s\n", errmsg));
+ sss_log(SSS_LOG_ERR, "LDAP connection error: %s", errmsg);
+ ldap_memfree(errmsg);
+ }
+ else {
+ sss_log(SSS_LOG_ERR, "LDAP connection error, %s",
+ ldap_err2string(lret));
+ }
+ }
+
+ else {
ret = EIO;
}
goto fail;