Commit cd288f14 authored by Evan Hunt's avatar Evan Hunt
Browse files

Merge branch '1163-geoip-subtype-fix' into 'v9_14'

fix a bug that could cause an assert when configuring "geoip continent"

See merge request !2200
parents fd5fc5b4 c3a996d5
Pipeline #18376 passed with stages
in 56 seconds
5268. [bug] named could crash during configuration if
configured to use "geoip continent" ACLs with
legacy GeoIP. [GL #1163]
5266. [bug] named-checkconf failed to report dnstap-output
missing from named.conf when dnstap was specified.
[GL #1136]
......
......@@ -14,7 +14,7 @@ rm -f ns2/example*.db
rm -f dig.out.* rndc.out.*
rm -f data2/*dat
[ -d data2 ] && rmdir data2
rm -f ns?/named.run
rm -f ns?/named.run ns?/named.run.*
rm -f ns?/named.memstats
rm -f ns*/named.lock
rm -f ns*/managed-keys.bind* ns*/*.mkeys*
......@@ -37,7 +37,7 @@ view two {
match-clients { geoip country US; };
zone "example" {
type master;
file "../ns2/example2.db";
file "example2.db";
};
};
......
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS2
options {
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { fd92:7065:b8e:ffff::2; };
recursion no;
dnssec-validation no;
geoip-directory "../data2";
};
key rndc_key {
secret "1234abcd8765";
algorithm hmac-sha256;
};
controls {
inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
view one {
match-clients { geoip continent EU; };
zone "example" {
type master;
file "example1.db";
};
};
view none {
zone "example" {
type master;
file "examplebogus.db";
};
};
......@@ -292,6 +292,7 @@ status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "reloading server with different geoip-directory ($n)"
ret=0
copy_setports ns2/named15.conf.in ns2/named.conf
rndc_reload ns2 10.53.0.2
sleep 3
......@@ -313,6 +314,16 @@ fi
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "reloading server with different geoip-directory, missing continent support ($n)"
nextpart ns2/named.run > /dev/null
copy_setports ns2/named16.conf.in ns2/named.conf
rndc_reload ns2 10.53.0.2 > /dev/null
sleep 3
nextpart ns2/named.run | grep 'no GeoIP database installed' > /dev/null 2>&1 || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking other GeoIP options are parsed correctly ($n)"
ret=0
......
......@@ -591,7 +591,7 @@ parse_geoip_element(const cfg_obj_t *obj, isc_log_t *lctx,
sizeof(de.geoip_elem.as_string));
} else {
cfg_obj_log(obj, lctx, ISC_LOG_ERROR,
"geoiop postal code (%s) too long",
"geoip postal code (%s) too long",
search);
return (ISC_R_FAILURE);
}
......@@ -820,7 +820,7 @@ geoip_can_answer(dns_aclelement_t *elt, cfg_aclconfctx_t *ctx) {
case dns_geoip_netspeed_id:
if (ctx->geoip->netspeed != NULL)
return (true);
/* FALLTHROUGH */
break;
/*
* The following enums are only valid with GeoIP2,
* not legacy GeoIP.
......@@ -920,7 +920,7 @@ parse_geoip_element(const cfg_obj_t *obj, isc_log_t *lctx,
sizeof(de.geoip_elem.as_string));
} else {
cfg_obj_log(obj, lctx, ISC_LOG_ERROR,
"geoiop postal code (%s) too long",
"geoip postal code (%s) too long",
search);
return (ISC_R_FAILURE);
}
......@@ -947,7 +947,7 @@ parse_geoip_element(const cfg_obj_t *obj, isc_log_t *lctx,
sizeof(de.geoip_elem.as_string));
} else if (strcasecmp(stype, "continent") == 0) {
cfg_obj_log(obj, lctx, ISC_LOG_ERROR,
"geoiop continent code (%s) too long", search);
"geoip continent code (%s) too long", search);
return (ISC_R_FAILURE);
} else if (strcasecmp(stype, "isp") == 0) {
subtype = dns_geoip_isp_name;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment