]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Improve the zones' view reverting logic when a zone is a catalog zone
authorAram Sargsyan <aram@isc.org>
Tue, 28 Dec 2021 12:08:48 +0000 (12:08 +0000)
committerAram Sargsyan <aram@isc.org>
Tue, 25 Jan 2022 08:20:52 +0000 (08:20 +0000)
When a zone is being configured with a new view, the catalog zones
structure will also be linked to that view. Later on, in case of some
error, should the zone be reverted to the previous view, the link
between the catalog zones structure and the view won't be reverted.

Change the dns_zone_setviewrevert() function so it calls
dns_zone_catz_enable() during a zone revert, which will reset the
link between `catzs` and view.

lib/dns/zone.c

index 60abf7dbb40913c3fce5a73344971d15a30520ef..ca9bbaec4c00463efb282523493e8c52419e4721 100644 (file)
@@ -1683,6 +1683,9 @@ dns_zone_setviewrevert(dns_zone_t *zone) {
                dns_zone_setview_helper(zone, zone->prev_view);
                dns_view_weakdetach(&zone->prev_view);
        }
+       if (zone->catzs != NULL) {
+               zone_catz_enable(zone, zone->catzs);
+       }
        if (inline_secure(zone)) {
                dns_zone_setviewrevert(zone->raw);
        }