]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Commit the change of view for view->managed_keys
authorOndřej Surý <ondrej@isc.org>
Tue, 17 Jan 2023 06:21:34 +0000 (07:21 +0100)
committerOndřej Surý <ondrej@isc.org>
Tue, 17 Jan 2023 20:48:30 +0000 (21:48 +0100)
When we change the view in the view->managed_keys, we never commit the
change, keeping the previous view possibly attached forever.

Call the dns_zone_setviewcommit() immediately after changing the view as
we are detaching the previous view anyway and there's no way to recover
from that.

bin/named/server.c

index 3be36685ae5c974fa4c39a5b2f5bd82bad5ee2e8..ef67cb81a4e3e34477925c003df619146a46caa3 100644 (file)
@@ -6900,6 +6900,7 @@ add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx) {
                        dns_zone_attach(pview->managed_keys,
                                        &view->managed_keys);
                        dns_zone_setview(pview->managed_keys, view);
+                       dns_zone_setviewcommit(pview->managed_keys);
                        dns_view_detach(&pview);
                        dns_zone_synckeyzone(view->managed_keys);
                        return (ISC_R_SUCCESS);