]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Henrik Nordstrom <hno@squid-cache.org>
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 7 Sep 2009 06:02:25 +0000 (18:02 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 7 Sep 2009 06:02:25 +0000 (18:02 +1200)
Bug 2510: digest_ldap_auth uses incorrect logic with TLS

helpers/digest_auth/ldap/ldap_backend.c

index 0e4a9fecdabab6452de5ff0f8b35787109ff8c62..47b440829cdbf70e0814d3a6ad6846cfcfb638f1 100644 (file)
@@ -361,10 +361,12 @@ ldapconnect(void)
         }
         if (use_tls) {
 #ifdef LDAP_OPT_X_TLS
-            if ((version == LDAP_VERSION3) && (ldap_start_tls_s(ld, NULL, NULL) == LDAP_SUCCESS)) {
+            if (version != LDAP_VERSION3) {
+                fprintf(stderr, "TLS requires LDAP version 3\n");
+                exit(1);
+            } else if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) {
                 fprintf(stderr, "Could not Activate TLS connection\n");
-                ldap_unbind(ld);
-                ld = NULL;
+                exit(1);
             }
 #else
             fprintf(stderr, "TLS not supported with your LDAP library\n");