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

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

+3 -1
View File
@@ -928,7 +928,9 @@ one service's connections alone, e.g.
connlim 5 60 * * * @1080 connlim 5 60 * * * @1080
.br .br
denies the sixth concurrent connection of the service on port 1080, denies the sixth concurrent connection of the service on port 1080,
whatever it connects to. For any field * whatever it connects to. A comma ends an entry, so several services are
listed by repeating it: *@1080,*@1090 names the two, and a bare
@1080,1090 would leave 1090 a destination port. For any field *
sign means ANY. If access list is empty it\'s assumed to be sign means ANY. If access list is empty it\'s assumed to be
.br .br
allow * allow *
+16
View File
@@ -97,3 +97,19 @@ def run(t):
"log\nallow * * * 443@\nnot_a_command\n") "log\nallow * * * 443@\nnot_a_command\n")
t.contains(out, "Invalid port or port range", t.contains(out, "Invalid port or port range",
"a service with nothing after the @ is refused") "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")