mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-04 00:00:14 -04:00
use NULL to load plugins from default plugin directory
This commit is contained in:
parent
6de28173f0
commit
5b03a350fc
@ -1,6 +1,5 @@
|
||||
INCLUDES = -I$(top_srcdir)/src/libstrongswan
|
||||
AM_CFLAGS = \
|
||||
-DIPSEC_PLUGINDIR=\"${plugindir}\" \
|
||||
-DPLUGINS="\"${libstrongswan_plugins}\"" \
|
||||
-DSTRONGSWAN_CONF=\"${strongswan_conf}\"
|
||||
|
||||
|
@ -102,7 +102,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
library_init(STRONGSWAN_CONF);
|
||||
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, argv[1]);
|
||||
lib->plugins->load(lib->plugins, NULL, argv[1]);
|
||||
atexit(library_deinit);
|
||||
|
||||
rounds = atoi(argv[2]);
|
||||
|
@ -17,7 +17,7 @@ int main(int argc, char *argv[])
|
||||
int read;
|
||||
|
||||
library_init(NULL);
|
||||
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, PLUGINS);
|
||||
lib->plugins->load(lib->plugins, NULL, PLUGINS);
|
||||
atexit(library_deinit);
|
||||
|
||||
read = fread(buf, 1, sizeof(buf), stdin);
|
||||
|
@ -17,7 +17,7 @@ int main(int argc, char *argv[])
|
||||
int read, n;
|
||||
|
||||
library_init(NULL);
|
||||
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, PLUGINS);
|
||||
lib->plugins->load(lib->plugins, NULL, PLUGINS);
|
||||
atexit(library_deinit);
|
||||
|
||||
read = fread(buf, 1, sizeof(buf), stdin);
|
||||
|
@ -60,7 +60,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
library_init(STRONGSWAN_CONF);
|
||||
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, argv[1]);
|
||||
lib->plugins->load(lib->plugins, NULL, argv[1]);
|
||||
atexit(library_deinit);
|
||||
|
||||
keydata = chunk_create(buf, 0);
|
||||
|
@ -106,7 +106,6 @@ INCLUDES = -I${linux_headers} -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/
|
||||
AM_CFLAGS = -rdynamic \
|
||||
-DIPSEC_DIR=\"${ipsecdir}\" \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\" \
|
||||
-DIPSEC_PLUGINDIR=\"${plugindir}\" \
|
||||
-DSTRONGSWAN_CONF=\"${strongswan_conf}\"
|
||||
charon_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la -lpthread -lm $(DLLIB) $(SOCKLIB)
|
||||
|
||||
|
@ -491,7 +491,7 @@ static bool initialize(private_daemon_t *this, bool syslog, level_t levels[])
|
||||
this->public.traps = trap_manager_create();
|
||||
|
||||
/* load plugins, further infrastructure may need it */
|
||||
if (!lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
|
||||
if (!lib->plugins->load(lib->plugins, NULL,
|
||||
lib->settings->get_str(lib->settings, "charon.load", PLUGINS)))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -3,7 +3,6 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
|
||||
|
||||
AM_CFLAGS = -rdynamic \
|
||||
-DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
|
||||
-DIPSEC_PLUGINDIR=\"${plugindir}\" \
|
||||
-DPLUGINS=\""${libstrongswan_plugins}\""
|
||||
|
||||
plugin_LTLIBRARIES = libstrongswan-sql.la
|
||||
|
@ -634,7 +634,7 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "integrity check of pool failed\n");
|
||||
exit(SS_RC_DAEMON_INTEGRITY);
|
||||
}
|
||||
if (!lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
|
||||
if (!lib->plugins->load(lib->plugins, NULL,
|
||||
lib->settings->get_str(lib->settings, "pool.load", PLUGINS)))
|
||||
{
|
||||
exit(SS_RC_INITIALIZATION_FAILED);
|
||||
|
@ -54,7 +54,7 @@ libstrongswan_la_LIBADD = -lpthread $(DLLIB) $(BTLIB) $(SOCKLIB) $(RTLIB)
|
||||
INCLUDES = -I$(top_srcdir)/src/libstrongswan
|
||||
AM_CFLAGS = \
|
||||
-DIPSEC_DIR=\"${ipsecdir}\" \
|
||||
-DIPSEC_PLUGINDIR=\"${plugindir}\"
|
||||
-DPLUGINDIR=\"${plugindir}\"
|
||||
|
||||
if USE_LEAK_DETECTIVE
|
||||
AM_CFLAGS += -DLEAK_DETECTIVE
|
||||
|
@ -116,6 +116,11 @@ static bool load(private_plugin_loader_t *this, char *path, char *list)
|
||||
char *token;
|
||||
bool critical_failed = FALSE;
|
||||
|
||||
if (path == NULL)
|
||||
{
|
||||
path = PLUGINDIR;
|
||||
}
|
||||
|
||||
enumerator = enumerator_create_token(list, " ", " ");
|
||||
while (!critical_failed && enumerator->enumerate(enumerator, &token))
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ struct plugin_loader_t {
|
||||
* as a critical plugin. If loading a critical plugin fails, plugin loading
|
||||
* is aborted and FALSE is returned.
|
||||
*
|
||||
* @param path path containing loadable plugins
|
||||
* @param path path containing loadable plugins, NULL for default
|
||||
* @param list space separated list of plugins to load
|
||||
* @return TRUE if all critical plugins loaded successfully
|
||||
*/
|
||||
|
@ -17,7 +17,6 @@ AM_CFLAGS = -rdynamic \
|
||||
-DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
|
||||
-DIPSECDIR=\"${ipsecdir}\" \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\" \
|
||||
-DIPSEC_PLUGINDIR=\"${plugindir}\"\
|
||||
-DPLUGINS=\""${libstrongswan_plugins}\""
|
||||
|
||||
# Don't forget to add templates to EXTRA_DIST !!! How to automate?
|
||||
|
@ -35,7 +35,7 @@ int main (int arc, char *argv[])
|
||||
int threads, timeout;
|
||||
|
||||
library_init(STRONGSWAN_CONF);
|
||||
if (!lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
|
||||
if (!lib->plugins->load(lib->plugins, NULL,
|
||||
lib->settings->get_str(lib->settings, "manager.load", PLUGINS)))
|
||||
{
|
||||
return 1;
|
||||
|
@ -14,7 +14,6 @@ AM_CFLAGS = -rdynamic \
|
||||
-DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
|
||||
-DIPSECDIR=\"${ipsecdir}\" \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\" \
|
||||
-DIPSEC_PLUGINDIR=\"${plugindir}\"\
|
||||
-DPLUGINS=\""${libstrongswan_plugins}\""
|
||||
|
||||
# Don't forget to add templates to EXTRA_DIST !!! How to automate?
|
||||
|
@ -34,7 +34,7 @@ int main(int arc, char *argv[])
|
||||
int timeout, threads;
|
||||
|
||||
library_init(STRONGSWAN_CONF);
|
||||
if (!lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
|
||||
if (!lib->plugins->load(lib->plugins, NULL,
|
||||
lib->settings->get_str(lib->settings, "medsrv.load", PLUGINS)))
|
||||
{
|
||||
return 1;
|
||||
|
@ -6,7 +6,6 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan
|
||||
AM_CFLAGS = \
|
||||
-DIPSEC_CONFDIR=\"${sysconfdir}\" \
|
||||
-DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
|
||||
-DIPSEC_PLUGINDIR=\"${plugindir}\" \
|
||||
-DPLUGINS=\""${libstrongswan_plugins}\""
|
||||
openac_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
|
||||
|
||||
|
@ -231,7 +231,7 @@ int main(int argc, char **argv)
|
||||
fprintf(stderr, "integrity check of openac failed\n");
|
||||
exit(SS_RC_DAEMON_INTEGRITY);
|
||||
}
|
||||
if (!lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
|
||||
if (!lib->plugins->load(lib->plugins, NULL,
|
||||
lib->settings->get_str(lib->settings, "openac.load", PLUGINS)))
|
||||
{
|
||||
exit(SS_RC_INITIALIZATION_FAILED);
|
||||
|
@ -7,6 +7,5 @@ pki_SOURCES = pki.c pki.h command.c command.h \
|
||||
pki_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
|
||||
INCLUDES = -I$(top_srcdir)/src/libstrongswan
|
||||
AM_CFLAGS = \
|
||||
-DPLUGINDIR=\"${plugindir}\" \
|
||||
-DPLUGINS=\""${libstrongswan_plugins}\"" \
|
||||
-DSTRONGSWAN_CONF=\"${strongswan_conf}\"
|
||||
|
@ -89,7 +89,7 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "integrity check of pki failed\n");
|
||||
exit(SS_RC_DAEMON_INTEGRITY);
|
||||
}
|
||||
if (!lib->plugins->load(lib->plugins, PLUGINDIR,
|
||||
if (!lib->plugins->load(lib->plugins, NULL,
|
||||
lib->settings->get_str(lib->settings, "pki.load", PLUGINS)))
|
||||
{
|
||||
exit(SS_RC_INITIALIZATION_FAILED);
|
||||
|
@ -68,7 +68,6 @@ AM_CFLAGS = \
|
||||
-DIPSEC_CONFDIR=\"${sysconfdir}\" \
|
||||
-DIPSEC_PIDDIR=\"${piddir}\" \
|
||||
-DSHARED_SECRETS_FILE=\"${confdir}/ipsec.secrets\" \
|
||||
-DIPSEC_PLUGINDIR=\"${plugindir}\" \
|
||||
-DPLUGINS=\""${pluto_plugins}\"" \
|
||||
-DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
|
||||
-DPKCS11_DEFAULT_LIB=\"${default_pkcs11}\" \
|
||||
|
@ -652,7 +652,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* load plugins, further infrastructure may need it */
|
||||
if (!lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
|
||||
if (!lib->plugins->load(lib->plugins, NULL,
|
||||
lib->settings->get_str(lib->settings, "pluto.load", PLUGINS)))
|
||||
{
|
||||
exit(SS_RC_INITIALIZATION_FAILED);
|
||||
|
@ -17,7 +17,6 @@ INCLUDES = \
|
||||
|
||||
AM_CFLAGS = \
|
||||
-DIPSEC_CONFDIR=\"${sysconfdir}\" \
|
||||
-DIPSEC_PLUGINDIR=\"${plugindir}\" \
|
||||
-DPLUGINS=\""${pluto_plugins}\"" \
|
||||
-DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
|
||||
-DDEBUG -DNO_PLUTO
|
||||
|
@ -759,7 +759,7 @@ int main(int argc, char **argv)
|
||||
init_log("scepclient");
|
||||
|
||||
/* load plugins, further infrastructure may need it */
|
||||
if (!lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
|
||||
if (!lib->plugins->load(lib->plugins, NULL,
|
||||
lib->settings->get_str(lib->settings, "scepclient.load", PLUGINS)))
|
||||
{
|
||||
exit_scepclient("plugin loading failed");
|
||||
|
Loading…
x
Reference in New Issue
Block a user