]> git.ipfire.org Git - thirdparty/squid.git/commit
Update External ACL helpers error handling and caching
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 26 Jan 2017 17:46:17 +0000 (06:46 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 26 Jan 2017 17:46:17 +0000 (06:46 +1300)
commit7686cf0fee811e59b320bc09d915802c0bf6e876
treeccfc067b5ecec7740452354b064884e224a1633b
parent1470f89197fe7557308159de17eef5997200240d
Update External ACL helpers error handling and caching

The helper protocol for external ACLs [1] defines three possible return values:
   OK - Success. ACL test matches.
   ERR - Success. ACL test fails to match.
   BH - Failure. The helper encountered a problem.

The external acl helpers distributed with squid currently do not follow this
definition. For example, upon connection error, ERR is returned:

   $ ext_ldap_group_acl ... -d
   ext_ldap_group_acl: WARNING: could not bind to binddn 'Can't contact LDAP server'
   ERR

This does not allow to distinguish "no match" and "error" either and
therefore negative caches "ERR", also in the case of an error.

Moreover there are multiple problems inside squid when trying to handle BH
responses:
  - Squid-5 and Squid-4 retry requests for BH responses but crashes after the
    maximum retry number (currently 2) is reached.
  - If an external acl helper return always BH (eg because the LDAP server is
    down) squid sends infinitely new request to the helper.

This is a Measurement Factory project
src/acl/external/AD_group/ext_ad_group_acl.cc
src/acl/external/LDAP_group/ext_ldap_group_acl.cc
src/acl/external/LM_group/ext_lm_group_acl.cc
src/acl/external/SQL_session/ext_sql_session_acl.pl.in
src/acl/external/eDirectory_userip/ext_edirectory_userip_acl.cc
src/acl/external/file_userip/ext_file_userip_acl.cc
src/acl/external/time_quota/ext_time_quota_acl.cc
src/acl/external/unix_group/check_group.cc
src/external_acl.cc
src/helper.cc
src/helper/protocol_defines.h