]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a new check for the 'geoip2' system test
authorAram Sargsyan <aram@isc.org>
Mon, 25 May 2026 14:17:26 +0000 (14:17 +0000)
committerAram Sargsyan <aram@isc.org>
Thu, 11 Jun 2026 13:28:21 +0000 (13:28 +0000)
Check that an ACL can't be matched by a substring in the
GeoIP database, instead of the full string comparision.

bin/tests/system/geoip2/data/GeoIP2-Domain.json
bin/tests/system/geoip2/data/GeoIP2-Domain.mmdb
bin/tests/system/geoip2/ns2/named11.conf.j2
bin/tests/system/geoip2/setup.sh
bin/tests/system/geoip2/tests.sh

index fb8e914fe54610fa4fec9f84269163f8e1a4689e..6786de7fa6adc40b2aa2a6f04cfc931751b5d6be 100644 (file)
          "domain" : "seven.org"
       }
    },
+   {
+      "::10.53.0.8/128" : {
+         "domain" : "seven"
+      }
+   },
    {
       "fd92:7065:b8e:ffff::1/128" : {
          "domain" : "one.de"
       "fd92:7065:b8e:ffff::7/128" : {
          "domain" : "seven.org"
       }
+   },
+   {
+      "fd92:7065:b8e:ffff::8/128" : {
+         "domain" : "seven"
+      }
    }
 ]
index fe93decbbebf03ce5a0dcbad5d3beec5bddf7212..a0ee647f16d3ae64273deafe83f1ed586338b085 100644 (file)
Binary files a/bin/tests/system/geoip2/data/GeoIP2-Domain.mmdb and b/bin/tests/system/geoip2/data/GeoIP2-Domain.mmdb differ
index 7cc64c3a07aa9db382ea02adbd26e350009d8e86..87c592d0b9d51e6c596f43cf625ebc1d696f904b 100644 (file)
@@ -78,6 +78,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" {
index f3acf988c5d9d6235a7a4c8f93bf0236b85854a6..20b64462da5c657e7957273ac6318679dd34bf62 100644 (file)
@@ -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 other bogus; do
   cp ns2/example.db.in ns2/example${i}.db
   echo "@ IN TXT \"$i\"" >>ns2/example$i.db
 done
index a8e8845a41b72aad1ed54440c5fe68701c4c0de2..b448694cf85703ea9a6a22d4f116a962bd63144f 100644 (file)
@@ -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