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 bdf4ab9280)
This commit is contained in:
Aram Sargsyan 2026-05-25 14:17:26 +00:00 committed by Arаm Sаrgsyаn
parent 6a533ec622
commit 4fc13d7f62
5 changed files with 21 additions and 3 deletions

View file

@ -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"
}
}
]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -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" {

View 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 8 other bogus; do
cp ns2/example.db.in ns2/example${i}.db
echo "@ IN TXT \"$i\"" >>ns2/example$i.db
done

View 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