]> git.ipfire.org Git - thirdparty/squid.git/commit
Honor directive parameters after a quoted filename reference (#2457) auto master
authorMike Lothian <mike@fireburn.co.uk>
Mon, 13 Jul 2026 00:07:48 +0000 (00:07 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 13 Jul 2026 00:29:26 +0000 (00:29 +0000)
commit6f4c814b8181c38c56be817f2d339936b63b408f
tree29bc1226f3a6268bf43de543567b2030fc92e2a2
parent975d82c54eb9d6458eb8a0c968ab8774607d011e
Honor directive parameters after a quoted filename reference (#2457)

For example, the following ACL did not match `example.com`:

    acl foo dstdomain "file-of-domains.txt" example.com

strtokFile() implements the "read directive parameters from a quoted
file" syntax used when configuration_includes_quoted_values is off (the
documented default). Once the named file's lines were exhausted,
strtokFile() returned nullptr, signalling end-of-directive to callers
such as ACLDomainData::parse(). Any tokens following the quoted filename
on the same configuration line (e.g., "example.com" above) were silently
discarded. A parameter file reference and trailing literal parameters
are valid syntax individually; combining them on one line has always
been allowed by the grammar, so the omission was "invisible" to admins.

This bug dates back to 2008 commit f32cd13e ("Replace cnfig parser gotos
with do-while loop."), which replaced a goto that resumed parsing after
the file's last line with an unconditional "return nullptr". Every Squid
release starting with v3.1.0.1 is affected.
CONTRIBUTORS
src/ConfigParser.cc
test-suite/squidconf/bad-acl-dstdomain-dupe.conf
test-suite/squidconf/bad-acl-dstdomain-dupe.conf.instructions
test-suite/squidconf/bad-acl-dstdomain-dupe.domains [new file with mode: 0644]