[exim-dev] [Bug 1375] Rebinding to existing ldap-connection …

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Todd Lyons
日付:  
To: exim-dev
題目: [exim-dev] [Bug 1375] Rebinding to existing ldap-connection with starttls
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1375




--- Comment #2 from Todd Lyons <tlyons@???> 2013-08-06 17:11:35 ---
On Fri, Aug 2, 2013 at 2:23 AM, Alexander Miroch
<miroch.alexander@???> wrote:
> http://bugs.exim.org/show_bug.cgi?id=1375
> +  int is_start_tls_called;
> +  lcp->is_start_tls_called = 0;
> -  if (eldap_start_tls)
> +  if (eldap_start_tls && !lcp->is_start_tls_called)
> +
> +       lcp->is_start_tls_called = 1;


Does anybody have any comment on this? I've converted his patch to
use BOOL instead of int. It builds with no errors, but I don't have
an infrastructure to test it. If Alexander and then commit it if
there are no objections. The diff looks like this:

diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c
index 40345ba..d9d7e3d 100644
--- a/src/src/lookups/ldap.c
+++ b/src/src/lookups/ldap.c
@@ -82,6 +82,7 @@ typedef struct ldap_connection {
BOOL bound;
int port;
LDAP *ld;
+ BOOL is_start_tls_called;
} LDAP_CONNECTION;

static LDAP_CONNECTION *ldap_connections = NULL;
@@ -493,6 +494,7 @@ if (lcp == NULL)
lcp->port = port;
lcp->ld = ld;
lcp->next = ldap_connections;
+ lcp->is_start_tls_called = FALSE;
ldap_connections = lcp;
}

@@ -519,7 +521,7 @@ if (!lcp->bound ||
   {
   DEBUG(D_lookup) debug_printf("%sbinding with user=%s password=%s\n",
     (lcp->bound)? "re-" : "", user, password);
-  if (eldap_start_tls)
+  if (eldap_start_tls && !lcp->is_start_tls_called)
     {
 #if defined(LDAP_OPT_X_TLS) && !defined(LDAP_LIB_SOLARIS)
     /* The Oracle LDAP libraries (LDAP_LIB_TYPE=SOLARIS) don't support this.
@@ -533,6 +535,7 @@ if (!lcp->bound ||
           " %s", host, porttext, rc, ldap_err2string(rc));
       goto RETURN_ERROR;
       }
+    lcp->is_start_tls_called = TRUE;
 #else
     DEBUG(D_lookup)
       debug_printf("TLS initiation not supported with this Exim and
your LDAP library.\n");



...Todd


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email