From 4ac4640c40b0fe8f5fd86a32b710d82e898b9317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Fri, 22 Apr 2022 13:27:12 +0200 Subject: [PATCH] Fix loading plugins using just their filenames BIND 9 plugins are installed using Automake's pkglib_LTLIBRARIES stanza, which causes the relevant shared objects to be placed in the $(libdir)/@PACKAGE@/ directory, where @PACKAGE@ is expanded to the lowercase form of the first argument passed to AC_INIT(), i.e. "bind". Meanwhile, NAMED_PLUGINDIR - the preprocessor macro that the ns_plugin_expandpath() function uses for determining the absolute path to a plugin for which only a filename has been provided (rather than a path) - is set to $(libdir)/named. This discrepancy breaks loading plugins using just their filenames. Fix the issue (and also prevent it from reoccurring) by setting NAMED_PLUGINDIR to $(pkglibdir). (cherry picked from commit 5065c4686e08ad412eb0ff1e65cb8f4e18533439) --- Makefile.tests | 2 +- lib/ns/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.tests b/Makefile.tests index 97a914db6a..7ae2c5ada1 100644 --- a/Makefile.tests +++ b/Makefile.tests @@ -12,7 +12,7 @@ AM_CFLAGS += \ AM_CPPFLAGS += \ $(CMOCKA_CFLAGS) \ - -DNAMED_PLUGINDIR=\"$(libdir)/named\" \ + -DNAMED_PLUGINDIR=\"$(pkglibdir)\" \ -DSKIPPED_TEST_EXIT_CODE=77 \ -DTESTS_DIR=\"$(abs_srcdir)\" diff --git a/lib/ns/Makefile.am b/lib/ns/Makefile.am index 503b7283b0..b2d5d73b4c 100644 --- a/lib/ns/Makefile.am +++ b/lib/ns/Makefile.am @@ -1,7 +1,7 @@ include $(top_srcdir)/Makefile.top AM_CPPFLAGS += \ - -DNAMED_PLUGINDIR=\"$(libdir)/named\" + -DNAMED_PLUGINDIR=\"$(pkglibdir)\" lib_LTLIBRARIES = libns.la