]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Henrik Nordstrom <hno@squid-cache.org>
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 2 Oct 2009 08:06:26 +0000 (21:06 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 2 Oct 2009 08:06:26 +0000 (21:06 +1300)
Bug 2510: digest_ldap_auth uses incorrect logic with TLS

helpers/digest_auth/ldap/ldap_backend.c

index 4594a610ec7f25cc1eaa4927de96ca011c126feb..320f3971170ee397343a92a40d613e287b55d909 100644 (file)
@@ -361,11 +361,11 @@ ldapconnect(void)
        }
        if (use_tls) {
 #ifdef LDAP_OPT_X_TLS
-           if ((version == LDAP_VERSION3) && (ldap_start_tls_s(ld, NULL, NULL) == LDAP_SUCCESS)) {
-               fprintf(stderr, "Could not Activate TLS connection\n");
-               ldap_unbind(ld);
-               ld = NULL;
-           }
+            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) {
+                exit(1);
 #else
            fprintf(stderr, "TLS not supported with your LDAP library\n");
            ldap_unbind(ld);