]> git.kaiwu.me - haproxy.git/commit
MINOR: sample: add SMP_USE__MAY_ALIAS to mark fetches returning aliasable contents
authorWilly Tarreau <w@1wt.eu>
Wed, 11 Nov 2026 11:31:41 +0000 (13:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Nov 2026 17:12:23 +0000 (18:12 +0100)
commitb5cfeb14524ee38b171ac41fdd3244d9907e9f95
treea202d7855fdb2026a68a6cfe94cfda604d3ebfae
parent742af3e70bb6781c831728dd40378db780ed8229
MINOR: sample: add SMP_USE__MAY_ALIAS to mark fetches returning aliasable contents

Some sample fetches return contents which may be written in multiple
equivalent forms that are interpreted the same way by the next hop, for
example the path with its %-encoding, its case, or its "/./" and "../"
segments. Matching such contents against a pattern to deny requests is
unreliable, and we'll want to be able to detect such constructs at boot.

This adds SMP_USE__MAY_ALIAS, which is not a source but a property of the
fetched contents. It is placed in the ->use field so that it doesn't
require a new field in all fetch keywords, and since this field is
already or'ed into the ACLs and conditions, it will be possible to
quickly check if a condition involves such a fetch.

The double underscore marks the values which are properties of the
contents and not sources. They're not mapped to any SMP_SRC_* value, so
they're ignored when computing the validity domain. They are allocated
from the topmost bit downwards, leaving all the room to the sources
below, and a build time check verifies that the sources never reach
bit 31.
include/haproxy/sample-t.h
src/sample.c