acl: a rule names several services by repeating the entry
C/C++ CI Linux / ubuntu-24.04-arm (push) Waiting to run
C/C++ CI Linux / ubuntu-latest (push) Waiting to run
C/C++ CI MacOS / macos-15 (push) Waiting to run
C/C++ CI Windows / windows-2022 (push) Waiting to run
C/C++ CI cmake / macos-15 (push) Waiting to run
C/C++ CI cmake / ubuntu-24.04-arm (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (push) Waiting to run
C/C++ CI cmake / windows-2022 (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Waiting to run

A comma ends an entry of a port list, so a rule names several
services by repeating it, one with each: *@1080,*@1090 names the
two, and @1080-1090 names a range of ports. A bare @1080,1090
leaves 1090 a destination port, which the man page warns of.
This commit is contained in:
Vladimir Dubrovin committed 2026-11-21 17:10:40 +03:00
1 parent a3e93aa23a
commit b423efcc33
2 files changed
+19 -1

No files matched your search

+16
View File
@@ -97,3 +97,19 @@ def run(t):
"log\nallow * * * 443@\nnot_a_command\n")
t.contains(out, "Invalid port or port range",
"a service with nothing after the @ is refused")
# several services in one rule: the entry repeated with each
sev1, sev2 = t.free_port(), t.free_port()
t.start("viaport_both", f"""
log
auth iponly
deny * * * @{sev1},@{sev2}
allow *
proxy -p{sev1}
proxy -p{sev2}
""", ports=[sev1, sev2])
t.ne(200, t.http(url, proxy=f"127.0.0.1:{sev1}").status,
"the first service a repeated entry names is refused")
t.ne(200, t.http(url, proxy=f"127.0.0.1:{sev2}").status,
"and so is the second")