4539. [bug] Referencing a nonexistant zone with rpz could lead
to a assertion failure when configuring. [RT #43787]
(cherry picked from commit 762c4fc5a8)
This commit is contained in:
@@ -2160,7 +2160,6 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
|
||||
dns_acl_t *clients = NULL, *mapped = NULL, *excluded = NULL;
|
||||
unsigned int query_timeout, ndisp;
|
||||
struct cfg_context *nzctx;
|
||||
dns_rpz_zone_t *rpz;
|
||||
|
||||
REQUIRE(DNS_VIEW_VALID(view));
|
||||
|
||||
@@ -2319,22 +2318,6 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
|
||||
actx, ISC_FALSE));
|
||||
}
|
||||
|
||||
for (rpz = ISC_LIST_HEAD(view->rpz_zones);
|
||||
rpz != NULL;
|
||||
rpz = ISC_LIST_NEXT(rpz, link))
|
||||
{
|
||||
if (!rpz->defined) {
|
||||
char namebuf[DNS_NAME_FORMATSIZE];
|
||||
|
||||
dns_name_format(&rpz->origin, namebuf, sizeof(namebuf));
|
||||
cfg_obj_log(obj, ns_g_lctx, DNS_RPZ_ERROR_LEVEL,
|
||||
"'%s' is not a master or slave zone",
|
||||
namebuf);
|
||||
result = ISC_R_NOTFOUND;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If we're allowing added zones, then load zone configuration
|
||||
* from the newzone file for zones that were added during previous
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
options {
|
||||
response-policy {
|
||||
zone "nonexistent";
|
||||
};
|
||||
};
|
||||
@@ -48,8 +48,10 @@ for bad in bad*.conf
|
||||
do
|
||||
ret=0
|
||||
echo "I: checking that named-checkconf detects error in $bad"
|
||||
$CHECKCONF $bad > /dev/null 2>&1
|
||||
if [ $? != 1 ]; then echo "I:failed"; ret=1; fi
|
||||
$CHECKCONF $bad > checkconf.out 2>&1
|
||||
if [ $? != 1 ]; then ret=1; fi
|
||||
grep "^$bad:[0-9]*: " checkconf.out > /dev/null || ret=1
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user