]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix reloading inline-signed zones
authorMichał Kępień <michal@isc.org>
Wed, 22 Aug 2018 09:28:54 +0000 (11:28 +0200)
committerMichał Kępień <michal@isc.org>
Wed, 22 Aug 2018 09:46:08 +0000 (11:46 +0200)
commitcf7557dce09ad0ed73594afa90707db0ed70dc1e
tree6c0c5756a51776e1731efb0f77cecea8b23649f7
parent4f2481b4c25e109f52e2a46ce6d8ac0098d09408
Fix reloading inline-signed zones

While "rndc reload" causes dns_zone_asyncload() to be called for the
signed version of an inline-signed zone, the subsequent zone_load() call
causes the raw version to be reloaded from storage.  This means that
DNS_ZONEFLG_LOADPENDING gets set for the signed version of the zone by
dns_zone_asyncload() before the reload is attempted, but zone_postload()
is only called for the raw version and thus DNS_ZONEFLG_LOADPENDING is
cleared for the raw version, but not for the signed version.  This in
turn prevents zone maintenance from happening for the signed version of
the zone.

Until commit 749b3cacfc781122c94f2f183b9ee6dcbbb9864d, this problem
remained dormant because DNS_ZONEFLG_LOADPENDING was previously
immediately, unconditionally cleared after zone loading was started
(whereas it should only be cleared when zone loading is finished or an
error occurs).  This behavior caused other issues [1] and thus had to be
changed.

Fix reloading inline-signed zones by clearing DNS_ZONEFLG_LOADPENDING
for the signed version of the zone once the raw version reload
completes.  Take care not to clear it prematurely during initial zone
load.  Also make sure that DNS_ZONEFLG_LOADPENDING gets cleared when
zone_postload() encounters an error or returns early, to prevent other
scenarios from resulting in the same problem.  Add comments aiming to
help explain code flow.

[1] see RT #47076

(cherry picked from commit 5431583971bd5bea89e47356f28e7718814593c0)
bin/tests/system/inline/ns3/master5.db.in [new file with mode: 0644]
bin/tests/system/inline/ns3/named.conf.in
bin/tests/system/inline/tests.sh
lib/dns/zone.c
util/copyrights