2007-08-22 [colin] 2.10.0cvs146
authorColin Leroy <colin@colino.net>
Wed, 22 Aug 2007 08:58:53 +0000 (08:58 +0000)
committerColin Leroy <colin@colino.net>
Wed, 22 Aug 2007 08:58:53 +0000 (08:58 +0000)
* src/editldap.c
* src/ldaputil.c
Fix wrong "Connected successfully to server". Connection only succeeds if
we can get the base DN.

ChangeLog
PATCHSETS
configure.ac
src/editldap.c
src/ldaputil.c

index 1190f9351c37495c47afc650a0e9e19f73927e37..c0f235652ad4d7b1a712b37dd0452f5ea5e13cb2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-08-22 [colin]     2.10.0cvs146
+
+       * src/editldap.c
+       * src/ldaputil.c
+               Fix wrong "Connected successfully to server". Connection only succeeds if
+               we can get the base DN.
+
 2007-08-21 [wwp]       2.10.0cvs145
 
        * src/browseldap.c
index fa0c8545ee951d700faf9f7e8cb881cd4c8b3a0c..546ca29319b9a8a4a23e6240f7ca8a0651cbcd68 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.94.2.146 -r 1.94.2.147 src/messageview.c;  ) > 2.10.0cvs143.patchset
 ( cvs diff -u -r 1.105.2.108 -r 1.105.2.109 src/prefs_account.c;  ) > 2.10.0cvs144.patchset
 ( cvs diff -u -r 1.2.4.19 -r 1.2.4.20 src/browseldap.c;  cvs diff -u -r 1.8.2.26 -r 1.8.2.27 src/editldap.c;  cvs diff -u -r 1.2.2.14 -r 1.2.2.15 src/ldapctrl.c;  cvs diff -u -r 1.3.2.22 -r 1.3.2.23 src/ldapquery.c;  cvs diff -u -r 1.4.2.13 -r 1.4.2.14 src/ldapserver.c;  cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/ldapupdate.c;  cvs diff -u -r 1.1.4.9 -r 1.1.4.10 src/ldaputil.c;  ) > 2.10.0cvs145.patchset
+( cvs diff -u -r 1.8.2.27 -r 1.8.2.28 src/editldap.c;  cvs diff -u -r 1.1.4.10 -r 1.1.4.11 src/ldaputil.c;  ) > 2.10.0cvs146.patchset
index 678d3f793e862a229bd9cc5a778ed814e16f94c0..d6c55a35440cd01755dc7bc82b38beba7395e6ea 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=10
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=145
+EXTRA_VERSION=146
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 0d8c91f0cb166be147b453f6aea383bed7be46da..00c10a78d58ac259d36c6aa5a4964b0d62804639 100644 (file)
@@ -260,8 +260,10 @@ static void edit_ldap_server_check( void ) {
                                }
                                mgu_free_dlist( baseDN );
                                baseDN = node = NULL;
+                               flg = TRUE;
+                       } else {
+                               flg = FALSE;
                        }
-                       flg = TRUE;
                }
        }
        g_free( sHost );
index e29947816070e336a1488b24a529490dbb024e87..202ddf10fe1975a6e68c0bfe8d9a3f244229256f 100644 (file)
@@ -248,10 +248,12 @@ GList *ldaputil_read_basedn(
                return baseDN;
        }
 #ifdef USE_LDAP_TLS
-       if( tls && !ssl ) {
-               /* Handle TLS */
+       if (bindDN && *bindDN) {
                version = LDAP_VERSION3;
                rc = ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
+       }
+       if( tls && !ssl ) {
+               /* Handle TLS */
                if( rc != LDAP_OPT_SUCCESS ) {
                        ldap_unbind_ext( ld, NULL, NULL );
                        return baseDN;
@@ -269,6 +271,7 @@ GList *ldaputil_read_basedn(
                if( *bindDN != '\0' ) {
                        rc = claws_ldap_simple_bind_s( ld, bindDN, bindPW );
                        if( rc != LDAP_SUCCESS ) {
+                               g_printerr("LDAP: %s\n", ldap_err2string(rc));
                                ldap_unbind_ext( ld, NULL, NULL );
                                return baseDN;
                        }
@@ -348,6 +351,7 @@ gboolean ldaputil_test_connect( const gchar *host, const gint port, int ssl, int
 #endif
        if( ld != NULL ) {
                ldap_unbind_ext( ld, NULL, NULL );
+               debug_print("ld != NULL\n");
                retVal = TRUE;
        }
        return retVal;