use NULL to load plugins from default plugin directory
authorMartin Willi <martin@strongswan.org>
Tue, 8 Sep 2009 17:48:34 +0000 (19:48 +0200)
committerMartin Willi <martin@strongswan.org>
Thu, 10 Sep 2009 16:52:42 +0000 (18:52 +0200)
24 files changed:
scripts/Makefile.am
scripts/dh_speed.c
scripts/key2keyid.c
scripts/keyid2sql.c
scripts/pubkey_speed.c
src/charon/Makefile.am
src/charon/daemon.c
src/charon/plugins/sql/Makefile.am
src/charon/plugins/sql/pool.c
src/libstrongswan/Makefile.am
src/libstrongswan/plugins/plugin_loader.c
src/libstrongswan/plugins/plugin_loader.h
src/manager/Makefile.am
src/manager/main.c
src/medsrv/Makefile.am
src/medsrv/main.c
src/openac/Makefile.am
src/openac/openac.c
src/pki/Makefile.am
src/pki/pki.c
src/pluto/Makefile.am
src/pluto/plutomain.c
src/scepclient/Makefile.am
src/scepclient/scepclient.c

index 6c28b94..8a70d79 100644 (file)
@@ -1,6 +1,5 @@
 INCLUDES = -I$(top_srcdir)/src/libstrongswan
 AM_CFLAGS = \
--DIPSEC_PLUGINDIR=\"${plugindir}\" \
 -DPLUGINS="\"${libstrongswan_plugins}\"" \
 -DSTRONGSWAN_CONF=\"${strongswan_conf}\"
 
index 5a57bad..80a1d2d 100644 (file)
@@ -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]);
index cc3e0b1..cd6ebc1 100644 (file)
@@ -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);
index bf95217..2d17c27 100644 (file)
@@ -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);
index 99075d2..b51de09 100644 (file)
@@ -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);
index 20ca083..54fc764 100644 (file)
@@ -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)
 
index 260fc5e..2580430 100644 (file)
@@ -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;
index bf4963f..bbbc5a2 100644 (file)
@@ -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
index c029dea..d59c4c8 100644 (file)
@@ -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);
index 570c14e..ebf7e4e 100644 (file)
@@ -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
index 644ac1f..d4513f2 100644 (file)
@@ -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))
        {
index 0967b79..f72c91c 100644 (file)
@@ -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
         */
index 6c50f15..b5948c0 100644 (file)
@@ -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?
index 9152f56..990beda 100644 (file)
@@ -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;
index 8a0703e..be9360b 100644 (file)
@@ -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?
index d66d01e..15d1f7f 100644 (file)
@@ -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;
index b71e6a0..e36b623 100644 (file)
@@ -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
 
index 99af177..de95643 100755 (executable)
@@ -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);
index 3f2694d..7eb5795 100644 (file)
@@ -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}\"
index 896ad9d..aa873a4 100644 (file)
@@ -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);
index bac51e2..77d366b 100644 (file)
@@ -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}\" \
index 0de8d4d..18e8228 100644 (file)
@@ -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);
index 0638069..8a2837d 100644 (file)
@@ -17,7 +17,6 @@ INCLUDES = \
 
 AM_CFLAGS = \
 -DIPSEC_CONFDIR=\"${sysconfdir}\" \
--DIPSEC_PLUGINDIR=\"${plugindir}\" \
 -DPLUGINS=\""${pluto_plugins}\"" \
 -DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
 -DDEBUG -DNO_PLUTO
index 7a9e1ff..4b9c02e 100644 (file)
@@ -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");