[SSSD] [PATCH] Call ldap_install_tls() on ldaps connections

Sumit Bose sbose at redhat.com
Tue Jul 5 12:19:46 UTC 2011


Hi,

the ldap_init_fd() patch introduced another regression with ldaps URIs.
This patch should fix it.

bye,
Sumit
-------------- next part --------------
From 227a661dc28dafabef6edea61054ddf10986857b Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Tue, 5 Jul 2011 11:37:45 +0200
Subject: [PATCH] Call ldap_install_tls() on ldaps connections

---
 src/util/sss_ldap.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c
index e24ae82..1394b4d 100644
--- a/src/util/sss_ldap.c
+++ b/src/util/sss_ldap.c
@@ -422,6 +422,21 @@ static void sss_ldap_init_sys_connect_done(struct tevent_req *subreq)
         return;
     }
 
+    if (ldap_is_ldaps_url(state->uri)) {
+        lret = ldap_install_tls(state->ldap);
+        if (lret != LDAP_SUCCESS) {
+            if (lret == LDAP_LOCAL_ERROR) {
+                DEBUG(5, ("TLS/SSL already in place.\n"));
+            } else {
+                DEBUG(1, ("ldap_install_tls failed: %s\n",
+                          ldap_err2string(lret)));
+
+                tevent_req_error(req, EIO);
+                return;
+            }
+        }
+    }
+
     tevent_req_done(req);
     return;
 }
-- 
1.7.6



More information about the sssd-devel mailing list