]> git.ipfire.org Git - thirdparty/bind9.git/commit
check plugin config before registering
authorEvan Hunt <each@isc.org>
Sat, 27 Sep 2025 03:57:52 +0000 (20:57 -0700)
committerEvan Hunt <each@isc.org>
Tue, 30 Sep 2025 22:42:26 +0000 (15:42 -0700)
commit92cefc52bc3942503a50e0b0f176ba68bd7f5cfb
tree4403f8a92885d230a3cb3a9a1e791b59afc4dd6a
parent7fa4cbedc50e6d72838ed113798fcd420058a9b4
check plugin config before registering

In named_config_parsefile(), when checking the validity of
named.conf, the checking of plugin correctness was deliberately
postponed until the plugin is loaded and registered. However,
when the plugin was registered, the checking was never actually
done: the plugin_register() implementation was called, but
plugin_check() was not.

This made it necessary to duplicate the correctness checking in both
functions, so that both named-checkconf and named could catch errors.
That should not be required.

ns_plugin_register() now calls the check function before the register
function, and aborts if either one fails.  ns_plugin_check() calls only
the check function.  ns_plugin_check() is used by named-checkconf, and
ns_plugin_register() is used by named. (Note: this design has a
side effect that a call to ns_plugin_register() will result in the
plugin parameters being parsed twice at registration time.)

ns_plugin_check() now takes an additional argument for the hook
source: zone or view.
bin/plugins/filter-a.c
bin/plugins/filter-aaaa.c
bin/tests/system/hooks/driver/test-async.c
bin/tests/system/hooks/driver/test-syncplugin.c
lib/isccfg/check.c
lib/ns/hooks.c
lib/ns/include/ns/hooks.h