Skip to content

Commit a8981c8

Browse files
committed
2026-04-21
1 parent 1675e8e commit a8981c8

14 files changed

Lines changed: 1524 additions & 23 deletions

File tree

squid-dev/2026-April.txt

Lines changed: 474 additions & 0 deletions
Large diffs are not rendered by default.

squid-dev/2026-April/010018.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
</style>
1414
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
15-
<LINK REL="Previous" HREF="010022.html">
15+
<LINK REL="Previous" HREF="010025.html">
1616
<LINK REL="Next" HREF="010020.html">
1717
</HEAD>
1818
<BODY BGCOLOR="#ffffff">
@@ -23,7 +23,7 @@ <H1>[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods</H1>
2323
</A><BR>
2424
<I>Sun Apr 19 21:35:02 UTC 2026</I>
2525
<P><UL>
26-
<LI>Previous message (by thread): <A HREF="010022.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
26+
<LI>Previous message (by thread): <A HREF="010025.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
2727
</A></li>
2828
<LI>Next message (by thread): <A HREF="010020.html">[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods
2929
</A></li>
@@ -50,11 +50,13 @@ <H1>[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods</H1>
5050

5151

5252

53+
54+
5355
<!--endarticle-->
5456
<HR>
5557
<P><UL>
5658
<!--threads-->
57-
<LI>Previous message (by thread): <A HREF="010022.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
59+
<LI>Previous message (by thread): <A HREF="010025.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
5860
</A></li>
5961
<LI>Next message (by thread): <A HREF="010020.html">[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods
6062
</A></li>

squid-dev/2026-April/010020.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ <H1>[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods</H1>
5757

5858

5959

60+
61+
6062
<!--endarticle-->
6163
<HR>
6264
<P><UL>

squid-dev/2026-April/010022.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</style>
1414
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
1515
<LINK REL="Previous" HREF="010021.html">
16-
<LINK REL="Next" HREF="010018.html">
16+
<LINK REL="Next" HREF="010024.html">
1717
</HEAD>
1818
<BODY BGCOLOR="#ffffff">
1919
<H1>[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas</H1>
@@ -25,7 +25,7 @@ <H1>[squid-dev] Issue with acl note (without -m) splitting helper tokens contain
2525
<P><UL>
2626
<LI>Previous message (by thread): <A HREF="010021.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
2727
</A></li>
28-
<LI>Next message (by thread): <A HREF="010018.html">[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods
28+
<LI>Next message (by thread): <A HREF="010024.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
2929
</A></li>
3030
<LI> <B>Messages sorted by:</B>
3131
<a href="date.html#10022">[ date ]</a>
@@ -153,13 +153,14 @@ <H1>[squid-dev] Issue with acl note (without -m) splitting helper tokens contain
153153
Alex.
154154
</PRE>
155155

156+
156157
<!--endarticle-->
157158
<HR>
158159
<P><UL>
159160
<!--threads-->
160161
<LI>Previous message (by thread): <A HREF="010021.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
161162
</A></li>
162-
<LI>Next message (by thread): <A HREF="010018.html">[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods
163+
<LI>Next message (by thread): <A HREF="010024.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
163164
</A></li>
164165
<LI> <B>Messages sorted by:</B>
165166
<a href="date.html#10022">[ date ]</a>

squid-dev/2026-April/010023.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ <H1>[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods</H1>
6363

6464
</PRE>
6565

66+
67+
6668
<!--endarticle-->
6769
<HR>
6870
<P><UL>

squid-dev/2026-April/010024.html

Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2+
<HTML>
3+
<HEAD>
4+
<TITLE> [squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
5+
</TITLE>
6+
<LINK REL="Index" HREF="index.html" >
7+
<LINK REL="made" HREF="mailto:squid-dev%40lists.squid-cache.org?Subject=Re%3A%20%5Bsquid-dev%5D%20Issue%20with%20acl%20note%20%28without%20-m%29%20splitting%20helper%0A%20tokens%20containing%20commas&In-Reply-To=%3C3d5b3018-9757-4e7d-bb24-172c674c2359%40treenet.co.nz%3E">
8+
<META NAME="robots" CONTENT="index,nofollow">
9+
<style type="text/css">
10+
pre {
11+
white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
12+
}
13+
</style>
14+
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
15+
<LINK REL="Previous" HREF="010022.html">
16+
<LINK REL="Next" HREF="010025.html">
17+
</HEAD>
18+
<BODY BGCOLOR="#ffffff">
19+
<H1>[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas</H1>
20+
<B>Amos Jeffries</B>
21+
<A HREF="mailto:squid-dev%40lists.squid-cache.org?Subject=Re%3A%20%5Bsquid-dev%5D%20Issue%20with%20acl%20note%20%28without%20-m%29%20splitting%20helper%0A%20tokens%20containing%20commas&In-Reply-To=%3C3d5b3018-9757-4e7d-bb24-172c674c2359%40treenet.co.nz%3E"
22+
TITLE="[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas">squid3 at treenet.co.nz
23+
</A><BR>
24+
<I>Tue Apr 21 08:01:54 UTC 2026</I>
25+
<P><UL>
26+
<LI>Previous message (by thread): <A HREF="010022.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
27+
</A></li>
28+
<LI>Next message (by thread): <A HREF="010025.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
29+
</A></li>
30+
<LI> <B>Messages sorted by:</B>
31+
<a href="date.html#10024">[ date ]</a>
32+
<a href="thread.html#10024">[ thread ]</a>
33+
<a href="subject.html#10024">[ subject ]</a>
34+
<a href="author.html#10024">[ author ]</a>
35+
</LI>
36+
</UL>
37+
<HR>
38+
<!--beginarticle-->
39+
<PRE>On 21/04/2026 06:59, Alex Rousskov wrote:
40+
&gt;<i> On 2026-04-17 09:08, Andrey K wrote:
41+
</I>&gt;<i>
42+
</I>&gt;&gt;<i> While working with annotations, I&#8217;ve noticed an inconsistency in how
43+
</I>&gt;&gt;<i> acl note (without the -m option) handles tokens received from helpers
44+
</I>&gt;&gt;<i> when they contain a comma.
45+
</I>&gt;<i>
46+
</I>&gt;<i> I think it is important to note that there are several distinct players
47+
</I>&gt;<i> here, including:
48+
</I>&gt;<i>
49+
</I>&gt;<i> 1. What annotations the helper sends to Squid.
50+
</I>&gt;<i>
51+
</I>
52+
Which is:
53+
54+
group=&quot;Staff:accountants,lawyers,security&quot;
55+
56+
57+
&gt;<i> 2. How helper response parser converts received helper response into
58+
</I>&gt;<i> &#160;&#160; transaction annotations.
59+
</I>&gt;<i>
60+
</I>
61+
Which is:
62+
63+
1) remove double-quotes
64+
2) translate \-escapes within quoted-string values
65+
3) translate %-coded within token values
66+
67+
Nothing more. ',' is not special for that parser.
68+
69+
70+
&gt;<i> 3. How the &quot;note&quot; ACL code interprets transaction annotations.
71+
</I>&gt;<i> &#160;&#160; These annotations may come from sources other than a helper.
72+
</I>&gt;<i>
73+
</I>
74+
This is where ',' becomes special as a list delimiter.
75+
76+
The annotation system interprets &quot;a,b,c&quot; as a set of three values,
77+
stored as a list.
78+
79+
(I do not understand why we need to store annotations in their
80+
serialized format in the first place. It is generally a bad design.)
81+
82+
83+
&gt;<i>
84+
</I>&gt;&gt;<i> According to the documentation, an ACL like this:
85+
</I>&gt;&gt;<i> &#160;&#160; &#160; acl staff note group Staff:accountants,lawyers,security
86+
</I>&gt;&gt;<i> should match a helper response such as:
87+
</I>&gt;&gt;<i> &#160;&#160; &#160; group=&quot;Staff:accountants,lawyers,security&quot;
88+
</I>&gt;<i>
89+
</I>&gt;<i> The above implies that helper response parser should not split group=X
90+
</I>&gt;<i> response fields (using comma as a delimiter). Do we document that
91+
</I>&gt;<i> anywhere?
92+
</I>
93+
The only thing the helper response parser does is remove the DQUOTE
94+
characters around the value string.
95+
96+
As you noted below, the problem is ACL logic interaction with the
97+
annotation storage.
98+
99+
100+
&gt;<i> Did our helper response parser ever split such fields in the
101+
</I>&gt;<i> past?
102+
</I>&gt;<i>
103+
</I>
104+
If it did that was a bug. Prior to the annotations feature we did not
105+
support key=value-list, only key=value (singular value).
106+
107+
108+
109+
&gt;<i> BTW, 2015 commit 76ee67ac used a very similar example. AFAICT by looking
110+
</I>&gt;<i> at that code, we did not apply value delimiters by default back then
111+
</I>&gt;<i> (i.e. when ACL_F_SUBSTRING a.k.a. &quot;-m&quot; flag was not set). The bug was
112+
</I>&gt;<i> introduced in 2017 commit 4eac3407 that replaced a possibly-nil
113+
</I>&gt;<i> `flags.delimiters()` with a never-nil `&amp;delimiters.value`.
114+
</I>&gt;<i>
115+
</I>&gt;<i> The following comment suggests that we missed the fact that using the
116+
</I>&gt;<i> [default-initialized] value &quot;without checking whether the option is
117+
</I>&gt;<i> enabled()&quot; is a bug -- the corresponding &quot;trick&quot; never fully worked:
118+
</I>&gt;<i>
119+
</I>&gt;<i> ```C++
120+
</I>&gt;<i> // TODO: Some callers use .value without checking whether the option is
121+
</I>&gt;<i> // enabled(), accessing the (default-initialized or customized) default
122+
</I>&gt;<i> // value that way. This trick will stop working if we add valued options
123+
</I>&gt;<i> // that can be disabled (e.g., --with-foo=x --without-foo).
124+
</I>&gt;<i> ```
125+
</I>&gt;<i>
126+
</I>&gt;<i>
127+
</I>&gt;&gt;<i> However, this is not the case. The helper's response is split into
128+
</I>&gt;&gt;<i> tokens using a comma as the default delimiter. As a result, only ACLs
129+
</I>&gt;&gt;<i> like the following will match:
130+
</I>&gt;&gt;<i> &#160;&#160; &#160; acl staff note group lawyers
131+
</I>&gt;&gt;<i>
132+
</I>&gt;&gt;<i> This behavior occurs because in Acl::NoteCheck::matchNotes(), a comma
133+
</I>&gt;&gt;<i> is passed as the default delimiter to the expandListEntries() function
134+
</I>&gt;<i>
135+
</I>&gt;<i> Agreed.
136+
</I>&gt;<i>
137+
</I>
138+
Nod.
139+
140+
&gt;<i>
141+
</I>&gt;&gt;<i> I would like to propose two changes:
142+
</I>&gt;&gt;<i> 1. Removing the default comma delimiter.
143+
</I>&gt;<i>
144+
</I>&gt;<i> ... and check enabled() before using the stored value, fixing the bug
145+
</I>&gt;<i> introduced in 2017 commit 4eac3407.
146+
</I>&gt;<i>
147+
</I>
148+
IMO that is the initial bug causing issues.
149+
150+
151+
152+
&gt;<i>
153+
</I>&gt;&gt;<i> I am prepared to submit a simple PR to exclude this comma to fix the
154+
</I>&gt;&gt;<i> incorrect matching of strings containing commas.
155+
</I>&gt;&gt;<i> However, I realize this might be a breaking change for users who
156+
</I>&gt;&gt;<i> currently rely on this implicit splitting behavior.
157+
</I>&gt;<i>
158+
</I>&gt;<i> Yes. We should disclose the bug fix in Squid release notes.
159+
</I>&gt;<i>
160+
</I>&gt;<i> We can also add code to warn admins (via a cache.log WARNING message)
161+
</I>&gt;<i> when a &quot;note&quot; ACL configured without &quot;-m&quot; looks at an annotation value
162+
</I>&gt;<i> containing a comma, but that requires more work.
163+
</I>&gt;<i>
164+
</I>&gt;<i>
165+
</I>&gt;&gt;<i> 2. Supporting custom delimiters in helper responses.
166+
</I>&gt;&gt;<i> I also propose a PR to support a format where tag values can be passed
167+
</I>&gt;&gt;<i> as a list with a custom delimiter:
168+
</I>&gt;&gt;<i> &#160;&#160; &#160; &lt;key&gt;=&lt;delimiter&gt;&quot;&lt;value1&gt;&lt;delimiter&gt;&lt;value2&gt;...&quot;
169+
</I>&gt;&gt;<i> For example:
170+
</I>&gt;&gt;<i> &#160;&#160; &#160; group=,&quot;group1,group2,group3&quot;
171+
</I>&gt;&gt;<i> &#160;&#160; &#160; clt_con_tag=;&quot;tag1;tag2;tag3&quot;
172+
</I>&gt;&gt;<i> In this PR, the helper response would be tokenized based on the
173+
</I>&gt;&gt;<i> specified custom delimiter, while still supporting delimiter escaping
174+
</I>&gt;&gt;<i> with a backslash (\).
175+
</I>&gt;<i>
176+
</I>&gt;<i> I do not think this hack will work well as is, without syntax
177+
</I>&gt;<i> modifications because Squid already uses double quotes specially in this
178+
</I>&gt;<i> context. Overloading quotation meaning would be confusing/wrong.
179+
</I>&gt;<i>
180+
</I>&gt;<i> Overall, I am not excited about this hack, but let's start with these
181+
</I>&gt;<i> questions about its scope:
182+
</I>&gt;<i>
183+
</I>&gt;<i> * Can the same effect be achieved today by sending a helper response
184+
</I>&gt;<i> containing multiple same-name annotations? For example:
185+
</I>&gt;<i>
186+
</I>&gt;<i> &#160;&#160;&#160; group=group1 group=group2 group=group3
187+
</I>&gt;<i>
188+
</I>
189+
No. That will be added as three different kv-pair by the helper logic.
190+
191+
The annotations storing kv-pair in MiME syntax with mixed arbitrary
192+
key=value and key=list,of,values is a problem.
193+
194+
195+
&gt;<i> * If the &quot;note&quot; ACL bug is fixed, do we still need to allow helper to
196+
</I>&gt;<i> use custom value delimiters?
197+
</I>&gt;<i>
198+
</I>&gt;<i> * What would Squid do today if it receives a `group=,&quot;a,b&quot;` annotation
199+
</I>&gt;<i> from a helper? AFAICT from looking at
200+
</I>&gt;<i> Helper::Reply::parseResponseKeys(), Squid would silently treat the
201+
</I>&gt;<i> leading comma delimiter as the first character of the received
202+
</I>&gt;<i> annotation value and keep double quotes, right?
203+
</I>
204+
No. All double-quotes are removed.
205+
206+
That input would reach the annotations storage as:
207+
{ key: 'group', value: ',a,b' }
208+
209+
Then the annotation storage saves that as key=value,list syntax and
210+
expands it later. Same problems all over again.
211+
212+
213+
&gt;<i>
214+
</I>&gt;<i> * Squid does not treat backslashes in annotation values specially today,
215+
</I>&gt;<i> does it? If present, they become part of the annotation key or value,
216+
</I>&gt;<i> right?
217+
</I>
218+
No. They are translated by the helper response parser into octets.
219+
220+
221+
Input ' group=&quot;a\,b&quot; ' would reach the annotations storage as:
222+
{ key: 'group', value: 'a,b' }
223+
224+
225+
The bug is not in the helper protocol. It does **nothing** with comma.
226+
Correctly so IMO.
227+
228+
229+
HTH
230+
Amos
231+
232+
</PRE>
233+
234+
235+
<!--endarticle-->
236+
<HR>
237+
<P><UL>
238+
<!--threads-->
239+
<LI>Previous message (by thread): <A HREF="010022.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
240+
</A></li>
241+
<LI>Next message (by thread): <A HREF="010025.html">[squid-dev] Issue with acl note (without -m) splitting helper tokens containing commas
242+
</A></li>
243+
<LI> <B>Messages sorted by:</B>
244+
<a href="date.html#10024">[ date ]</a>
245+
<a href="thread.html#10024">[ thread ]</a>
246+
<a href="subject.html#10024">[ subject ]</a>
247+
<a href="author.html#10024">[ author ]</a>
248+
</LI>
249+
</UL>
250+
251+
<hr>
252+
<a href="https://lists.squid-cache.org/listinfo/squid-dev">More information about the squid-dev
253+
mailing list</a><br>
254+
</body></html>

0 commit comments

Comments
 (0)