]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove modified zone configuration from NZD
authorMatthijs Mekking <matthijs@isc.org>
Tue, 31 Mar 2026 12:47:43 +0000 (14:47 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Thu, 2 Apr 2026 12:35:54 +0000 (12:35 +0000)
When a zone that is configured in named.conf is modified with
'rndc modzone', the new zone configuration is now also stored in the
NZD.

This must be removed when the zone is deleted with 'rndc delzone',
otherwise a restart will fail.

bin/named/server.c

index 0ad94b76ac9b5743f602ec863764a838ba40f780..a8af9ff161659c511e2045af92f9d512f1aa019b 100644 (file)
@@ -12615,7 +12615,7 @@ rmzone(void *arg) {
        char zonename[DNS_NAME_FORMATSIZE];
        dns_view_t *view = NULL;
        dns_db_t *dbp = NULL;
-       bool added;
+       bool added, modded;
        isc_result_t result;
        MDB_txn *txn = NULL;
        MDB_dbi dbi;
@@ -12636,11 +12636,12 @@ rmzone(void *arg) {
         * (If this is a catalog zone member then nzf_config can be NULL)
         */
        added = dns_zone_getadded(zone);
+       modded = dns_zone_getmodded(zone);
        catz = dns_zone_get_parentcatz(zone);
 
        LOCK(&view->newzone.lock);
 
-       if (added && catz == NULL) {
+       if ((added || modded) && catz == NULL) {
                /* Make sure we can open the NZD database */
                result = nzd_open(view, 0, &txn, &dbi);
                if (result != ISC_R_SUCCESS) {