]> git.ipfire.org Git - thirdparty/bind9.git/commit
ensure rndc modzone succeeds twice for a zone in named.conf
authorJINMEI Tatuya <jtatuya@infoblox.com>
Mon, 23 Mar 2026 16:58:39 +0000 (09:58 -0700)
committerMatthijs Mekking <matthijs@isc.org>
Wed, 25 Mar 2026 08:38:16 +0000 (09:38 +0100)
commitf2115e9d58ee6584a091d697499875ff6a78a243
tree7cb252eec85de21646e5cd3d69ec4f8b970bfa28
parent17416af24878d305000ca9035b48a7d837973662
ensure rndc modzone succeeds twice for a zone in named.conf

If a zone is in named.conf, not originally added by rndc addzone,
rndc modzone for that zone succeeds once, but subsequent modzone
attempts fail. This is because do_modzone removes the zone config
from global or view options, but it would fail due to 'not found'
once the config is removed.

The fix is to ensure re-adding the updated zone config to the
global or view options. This also works as a more complete fix
for the issue 85453d3 atempted to solve, ensuring rndc showzone
shows the latest config: it now works for multple attemps of
modzone, and with named that is not built with LMDB.

The change in this commit relies on UNCONST in a few places.
That's not clean, but 'add/mod/delzone' generally seems to
need it (for example, delete_zoneconf uses it to modify the list
of zones). In that sense, this change follows the convention
(for a longer term, there may have to be a better API so that we
can modify config obtions that were once parsed).
bin/named/server.c
bin/tests/system/addzone/tests_rndc_modzone_without_add.py