]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
If a zone is not reusable, trigger full sign
authorMatthijs Mekking <matthijs@isc.org>
Tue, 11 Oct 2022 09:07:43 +0000 (11:07 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Thu, 3 Nov 2022 09:20:05 +0000 (10:20 +0100)
If after a reconfig a zone is not reusable because inline-signing
was turned on/off, trigger a full resign. This is necessary because
otherwise the zone maintenance may decide to only apply the changes
in the journal, leaving the zone in an inconsistent DNSSEC state.

bin/named/server.c

index b95d1ee108ba026c42090217d8a85cd0eb5a2a87..b38e00d027a3e5079a8bffc60edd2345892a81fd 100644 (file)
@@ -6501,6 +6501,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
        bool zone_is_catz = false;
        bool zone_maybe_inline = false;
        bool inline_signing = false;
+       bool fullsign = false;
 
        options = NULL;
        (void)cfg_map_get(config, "options", &options);
@@ -6769,6 +6770,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
 
        if (zone != NULL && !named_zone_reusable(zone, zconfig)) {
                dns_zone_detach(&zone);
+               fullsign = true;
        }
 
        if (zone != NULL && (rpz_num != dns_zone_get_rpz_num(zone) ||
@@ -6903,7 +6905,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
         * Ensure that zone keys are reloaded on reconfig
         */
        if ((dns_zone_getkeyopts(zone) & DNS_ZONEKEY_MAINTAIN) != 0) {
-               dns_zone_rekey(zone, false);
+               dns_zone_rekey(zone, fullsign);
        }
 
 cleanup: