]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix view's zones reverting bug during reconfiguration
authorAram Sargsyan <aram@isc.org>
Wed, 1 Mar 2023 12:30:46 +0000 (12:30 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 1 Mar 2023 15:40:33 +0000 (15:40 +0000)
commit78f1d256a3091aa471df26c2c4388f0eb634ac2b
tree850cbf78d966fa4eb4d4d77bd81f39c10f62403e
parent789ce76dd14be41ebe5f69c361d859cd810f736d
Fix view's zones reverting bug during reconfiguration

During reconfiguration, the configure_view() function reverts the
configured zones to the previous view in case if there is an error.

It uses the 'zones_configured' boolean variable to decide whether
it is required to revert the zones, i.e. the error happened after
all the zones were successfully configured.

The problem is that it does not account for the case when an error
happens during the configuration of one of the zones (not the first),
in which case there are zones that are already configured for the
new view (and they need to be reverted), and there are zones that
are not (starting from the failed one).

Since 'zones_configured' remains 'false', the configured zones are
not reverted.

Replace the 'zones_configured' variable with a pointer to the latest
successfully configured zone configuration element, and when reverting,
revert up to and including that zone.

(cherry picked from commit 84c235a4b0477a34c0ac2054af98b39efc5b0df5)
bin/named/server.c