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