]> git.ipfire.org Git - thirdparty/squid.git/commit
Warn about some bad from-helper annotations (#1221)
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 8 Jan 2023 12:43:48 +0000 (12:43 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 9 Jan 2023 19:47:06 +0000 (19:47 +0000)
commit27c36771bf145c2f8ca1efab6743b9e087867ab5
treecdd3437416d2bc1c6dba4279073c4282b6797db2
parent2e0942f94f80eb33c51e3dfa5d1fde35783fd8c8
Warn about some bad from-helper annotations (#1221)

From-helper annotations may belong to one or more of the following
(partially overlapping) categories:

* A1: Annotations with a name ending with an underscore. Those
  annotations are reserved for admin use. Example: "category_".

* A2: Annotations that this Squid version knows about and treats
  specially. Example: "clt_conn_tag".

* B1: Annotations that this Squid version does not know about at all.
  Future Squids may start using them specially. Example: "detail".

* B2: Annotations unused by this Squid build. Example: Squid
  ./configured with --disable-auth does not use "user" and "password"
  annotations received from an external ACL helper.

* B3: Annotations incompatible with the current helper response
  type/kind. Example: Digest authentication code does not use "ha1"
  annotation in ERR responses received from digest authentication
  helpers.

* B4: Annotations with repeated names (the first of them will be used).
  Example: "user" in OK replies from negotiate authentication helpers.

Warn about received helper annotations in the B1 category.

It is possible to also warn about B2 and B3 annotations, but several
draft implementations imply that such an improvement requires complex
code changes that may also increase Squid code maintenance overheads.

Warning about B4 annotations is not that difficult, but we must decide:

* Whether custom repeated annotation are actually bad (and should be
  reported or even ignored).

* Whether Squid-recognized repeated annotations are bad enough to
  warrant the decreased performance and increased code complexity that
  reporting them would require. In other words, do we want to penalize
  good helpers that do _not_ send any repeated Squid-recognized
  annotations (except, perhaps, "message") to warn about bad helpers
  that do?
src/helper/Reply.cc
src/helper/Reply.h