From: serassio <> Date: Wed, 14 Sep 2005 01:38:30 +0000 (+0000) Subject: Bug #1370: squid_ldap_auth -U does not work X-Git-Tag: SQUID_3_0_PRE4~629 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8c818e47e066e603af6b5afcb90269365c14f74;p=thirdparty%2Fsquid.git Bug #1370: squid_ldap_auth -U does not work by peter stamfest Forward port of 2.5 change --- diff --git a/helpers/basic_auth/LDAP/squid_ldap_auth.c b/helpers/basic_auth/LDAP/squid_ldap_auth.c index 8e1a32aebb..cd366d4da0 100644 --- a/helpers/basic_auth/LDAP/squid_ldap_auth.c +++ b/helpers/basic_auth/LDAP/squid_ldap_auth.c @@ -724,14 +724,16 @@ checkLDAP(LDAP * persistent_ld, const char *userid, const char *password, const } if (debug) - fprintf(stderr, "attempting to bind to user '%s'\n", dn); + fprintf(stderr, "attempting to authenticate user '%s'\n", dn); if (!bind_ld && !bind_once) bind_ld = persistent_ld; if (!bind_ld) bind_ld = open_ldap_connection(ldapServer, port); - if (passwdattr && ldap_compare_s(bind_ld, dn, passwdattr, password) != LDAP_COMPARE_TRUE) - ret = 1; - else if (ldap_simple_bind_s(bind_ld, dn, password) != LDAP_SUCCESS) + if (passwdattr) { + if (ldap_compare_s(bind_ld, dn, passwdattr, password) != LDAP_COMPARE_TRUE) { + ret = 1; + } + } else if (ldap_simple_bind_s(bind_ld, dn, password) != LDAP_SUCCESS) ret = 1; if (bind_ld != persistent_ld) { ldap_unbind(bind_ld);