]> git.ipfire.org Git - thirdparty/squid.git/commit - src/external_acl.cc
External ACL helpers error handling & caching
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 11 Jan 2017 19:06:57 +0000 (21:06 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 11 Jan 2017 19:06:57 +0000 (21:06 +0200)
commit194ccc9c4c16a5a2f282aa47ed8b4b6060ebb0f8
treef70a9db7beaa8b4d18f4f808954b32e7cea97ae5
parent9d52ba1165dfa797b4fe688b49f0c10dc98e25a5
External ACL helpers error handling & 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 doesn't 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 is 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 retries 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