]> git.ipfire.org Git - thirdparty/bind9.git/commit
Ensure the correct ordering zone_shutdown() vs zone_gotwritehandle()
authorMichał Kępień <michal@isc.org>
Thu, 30 Dec 2021 14:14:11 +0000 (15:14 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 5 Jan 2022 09:32:50 +0000 (10:32 +0100)
commit7b455124d5659c38198badac892e1ea065f1ec2a
tree000e0dec7ea8cb393ad9bb5e882be99eb0eae7c0
parente837701a361e1b266e777227774ec98690877185
Ensure the correct ordering zone_shutdown() vs zone_gotwritehandle()

When the signed version of an inline-signed zone is dumped to disk, the
serial number of the unsigned version of the zone is written in the
raw-format header so that the contents of the signed zone can be
resynchronized after named restart if the unsigned zone file is
modified while named is not running (see RT #26676).

In order for the serial number of the unsigned zone to be determined
during the dump, zone->raw must be set to a non-NULL value.  This
should always be the case as long as the signed version of the zone is
used for anything by named.

However, under certain circumstances the zone->raw could be set to NULL
while the zone is being dumped.

Defer detaching from zone->raw in zone_shutdown() if the zone is in the
process of being dumped to disk.

(cherry picked from commit cc1d4e1aa63fdc7e82a00fd7b06d50fb4dbc8e96)
lib/dns/zone.c