Commit dd7b0283ef for strongswan.org

commit dd7b0283efcdab275d07c7022d777180d52f1abc
Author: Tobias Brunner <tobias@strongswan.org>
Date:   Wed Jan 28 15:45:23 2026 +0100

    plugin-loader: Add option to change log message if plugin is not found

    Distributions like Debian/Ubuntu ship the plugins in multiple packages
    that are not all installed by default.  When running tools like pki or
    swanctl, which don't use modular loading with config snippets by default,
    there are errors in the output if these packages and plugins are
    currently not available.  In order to not alarm users, this change adds
    a configure option that package maintainers can use.  It causes the log
    level of the message to increase and also adds a note that mentions that
    plugins are potentially available in other packages (which should be the
    case unless the user tried to load a plugin, e.g. via load statement,
    that is not actually built and shipped by the package maintainers).

diff --git a/configure.ac b/configure.ac
index 87b7636bbc..3414045605 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,7 @@ ARG_WITH_SET([dev-headers],          [no], [install strongSwan development heade
 ARG_WITH_SET([printf-hooks],         [auto], [force the use of a specific printf hook implementation (auto, builtin, glibc, vstr).])
 ARG_WITH_SET([rubygemdir],           ["gem environment gemdir"], [path to install ruby gems to])
 ARG_WITH_SET([testable-ke],          [yes], [make key exchange implementations testable by providing a set_seed() method])
+ARG_WITH_SET([plugins-packaged-seperately], [no], [changes e.g. log messages for distributions that package plugins seperately])

 if test -n "$PKG_CONFIG"; then
 	systemdsystemunitdir_default=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
@@ -1944,6 +1945,10 @@ fi
 if test x$imc_swima = xtrue -o x$imv_swima = xtrue; then
 	AC_DEFINE([USE_JSON], [], [build code for JSON])
 fi
+if test "x$plugins_packaged_seperately" != xno; then
+	AC_DEFINE([PLUGINS_PACKAGED_SEPARATELY], [], [distribution ships plugins in multiple packages])
+fi
+

 # ====================================================
 #  options for enabled modules (see conf/Makefile.am)
diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c
index 65e73e468a..6cf5a0658f 100644
--- a/src/libstrongswan/plugins/plugin_loader.c
+++ b/src/libstrongswan/plugins/plugin_loader.c
@@ -477,8 +477,13 @@ static plugin_entry_t *load_plugin(private_plugin_loader_t *this, char *name,
 			{	/* try to load the plugin from a file */
 				break;
 			}
+#ifndef PLUGINS_PACKAGED_SEPARATELY
 			DBG1(DBG_LIB, "plugin '%s': failed to load - %s not found and no "
 				 "plugin file available", name, create);
+#else
+			DBG2(DBG_LIB, "plugin '%s': failed to load - %s not found, plugin "
+				 "may be shipped in a separate package", name, create);
+#endif
 			/* fall-through */
 		default:
 			return NULL;