From 4fc13d7f62811ef3fa7e35caa0e573353c1ffd58 Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Mon, 25 May 2026 14:17:26 +0000 Subject: [PATCH] Add a new check for the 'geoip2' system test Check that an ACL can't be matched by a substring in the GeoIP database, instead of the full string comparision. (cherry picked from commit bdf4ab92805011e8946c264a6962f26e32a3bc12) --- .../system/geoip2/data/GeoIP2-Domain.json | 10 ++++++++++ .../system/geoip2/data/GeoIP2-Domain.mmdb | Bin 2524 -> 2575 bytes bin/tests/system/geoip2/ns2/named11.conf.j2 | 8 ++++++++ bin/tests/system/geoip2/setup.sh | 2 +- bin/tests/system/geoip2/tests.sh | 4 ++-- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/bin/tests/system/geoip2/data/GeoIP2-Domain.json b/bin/tests/system/geoip2/data/GeoIP2-Domain.json index fb8e914fe5..6786de7fa6 100644 --- a/bin/tests/system/geoip2/data/GeoIP2-Domain.json +++ b/bin/tests/system/geoip2/data/GeoIP2-Domain.json @@ -34,6 +34,11 @@ "domain" : "seven.org" } }, + { + "::10.53.0.8/128" : { + "domain" : "seven" + } + }, { "fd92:7065:b8e:ffff::1/128" : { "domain" : "one.de" @@ -68,5 +73,10 @@ "fd92:7065:b8e:ffff::7/128" : { "domain" : "seven.org" } + }, + { + "fd92:7065:b8e:ffff::8/128" : { + "domain" : "seven" + } } ] diff --git a/bin/tests/system/geoip2/data/GeoIP2-Domain.mmdb b/bin/tests/system/geoip2/data/GeoIP2-Domain.mmdb index fe93decbbebf03ce5a0dcbad5d3beec5bddf7212..a0ee647f16d3ae64273deafe83f1ed586338b085 100644 GIT binary patch literal 2575 zcmZA1cX-rf9Ki8kN-2AnT_Efh+5^hQg;-kJT17=g5s&olZJW|d&g8DNC@vhh759X? z75Cl)_rSe(-MDb?^(Nmw#)tdobHDMvc}Jdz7$S0;NREgxPo$HM&JoEa>I`|%1-e2v z=ng%gC-j2e&cO;ZOi0U?hwJ6Gp=r7z^WIJWPOzPzXgZ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t{xpn`kvt<Kw zLa2j!Xn$#jrQ*1N*{$us<9COW;6ggo7XkOTmIBh(jVE zf25*Bl3~;=(n5<3%feb~@D3y;k`9xOh#N*3k%JlMfe%^8K^wF~2Xw-6I0O!b!{Bhe z+#^L+XpRWhVpNNfKS90mqjYkm7_B;L7ehzJNi6qhI0lY|2{2A9JXa3x#?SHm@M zEnEj{;Ci?LZiJgaZzI142tJKlS;TE{JKO_ zH?R@D75R>peGfmtkMI-x48Opy@EiONf54yc7yJ$X1Q-HZ{Su4<=mmw)8;YP0^o4%V z9|pic7zD*I7>2-57zV>(1dN1HFdD|dSQrQ6p#&ztM3@97Ook~i6{f*-m;p1P6v|*0 z%!YEPfQV+E7;`jpgZCHy&x}f)oWIHcOrQAwukME+jY7MHm%xDSY6%Fl(SQbn98{EmcoL@;6AcOF$2~if)f0CwP)=hxWs|bGSovAAx@WvunzUM#+0&7q zwcOMzG*yR{&ZLx?$$1&qSH9^wsm`)`JM-U?i|SIA)10%Km2VX4$J9G+LdD{4&dIJb Ssv0~McfCZ+x0kD~l79i1bWYg- diff --git a/bin/tests/system/geoip2/ns2/named11.conf.j2 b/bin/tests/system/geoip2/ns2/named11.conf.j2 index b6d2a44624..e684c9a6ad 100644 --- a/bin/tests/system/geoip2/ns2/named11.conf.j2 +++ b/bin/tests/system/geoip2/ns2/named11.conf.j2 @@ -91,6 +91,14 @@ view seven { }; }; +view eight { + match-clients { geoip domain seven; }; # non-matching name (a substring of the previous entry), see GL#6019 + zone "example" { + type primary; + file "example8.db"; + }; +}; + view none { match-clients { any; }; zone "example" { diff --git a/bin/tests/system/geoip2/setup.sh b/bin/tests/system/geoip2/setup.sh index f3acf988c5..20b64462da 100644 --- a/bin/tests/system/geoip2/setup.sh +++ b/bin/tests/system/geoip2/setup.sh @@ -13,7 +13,7 @@ . ../conf.sh -for i in 1 2 3 4 5 6 7 other bogus; do +for i in 1 2 3 4 5 6 7 8 other bogus; do cp ns2/example.db.in ns2/example${i}.db echo "@ IN TXT \"$i\"" >>ns2/example$i.db done diff --git a/bin/tests/system/geoip2/tests.sh b/bin/tests/system/geoip2/tests.sh index a8e8845a41..b448694cf8 100644 --- a/bin/tests/system/geoip2/tests.sh +++ b/bin/tests/system/geoip2/tests.sh @@ -431,7 +431,7 @@ n=$((n + 1)) echo_i "checking Domain database using IPv4 ($n)" ret=0 lret=0 -for i in 1 2 3 4 5 6 7; do +for i in 1 2 3 4 5 6 7 8; do $DIG $DIGOPTS txt example -b 10.53.0.$i >dig.out.ns2.test$n.$i || lret=1 j=$(cat dig.out.ns2.test$n.$i | tr -d '"') [ "$i" = "$j" ] || lret=1 @@ -446,7 +446,7 @@ if testsock6 fd92:7065:b8e:ffff::3; then echo_i "checking Domain database using IPv6 ($n)" ret=0 lret=0 - for i in 1 2 3 4 5 6 7; do + for i in 1 2 3 4 5 6 7 8; do $DIG $DIGOPTS6 txt example -b fd92:7065:b8e:ffff::$i >dig.out.ns2.test$n.$i || lret=1 j=$(cat dig.out.ns2.test$n.$i | tr -d '"') [ "$i" = "$j" ] || lret=1