diff options
author | Tobias Brunner <tobias@strongswan.org> | 2013-06-28 10:44:15 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2013-06-28 10:44:15 +0200 |
commit | b18a53171537f81e8dc4a094a5368bdd9d3c7e4f (patch) | |
tree | 27086abd13eb58d70a192321904d114957e0c56a | |
parent | 9da142b4dc151d4d9c1db2fb55b3a5203c1f1c8c (diff) | |
download | strongswan-b18a53171537f81e8dc4a094a5368bdd9d3c7e4f.tar.bz2 strongswan-b18a53171537f81e8dc4a094a5368bdd9d3c7e4f.tar.xz |
plugin-loader: Removed unused path argument of load() method
Multiple additional search paths can be added with the add_path()
method.
-rw-r--r-- | scripts/crypt_burn.c | 2 | ||||
-rw-r--r-- | scripts/dh_speed.c | 2 | ||||
-rw-r--r-- | scripts/dnssec.c | 2 | ||||
-rw-r--r-- | scripts/fetch.c | 2 | ||||
-rw-r--r-- | scripts/hash_burn.c | 2 | ||||
-rw-r--r-- | scripts/key2keyid.c | 2 | ||||
-rw-r--r-- | scripts/keyid2sql.c | 2 | ||||
-rw-r--r-- | scripts/pubkey_speed.c | 2 | ||||
-rw-r--r-- | scripts/tls_test.c | 2 | ||||
-rw-r--r-- | src/conftest/conftest.c | 2 | ||||
-rw-r--r-- | src/libcharon/daemon.c | 2 | ||||
-rw-r--r-- | src/libhydra/plugins/attr_sql/pool.c | 2 | ||||
-rw-r--r-- | src/libimcv/imcv.c | 2 | ||||
-rw-r--r-- | src/libimcv/imv/imv_policy_manager.c | 6 | ||||
-rw-r--r-- | src/libimcv/plugins/imv_os/pacman.c | 2 | ||||
-rw-r--r-- | src/libpts/plugins/imv_attestation/attest.c | 2 | ||||
-rw-r--r-- | src/libstrongswan/plugins/plugin_loader.c | 9 | ||||
-rw-r--r-- | src/libstrongswan/plugins/plugin_loader.h | 11 | ||||
-rw-r--r-- | src/libstrongswan/tests/test_runner.c | 2 | ||||
-rw-r--r-- | src/manager/main.c | 2 | ||||
-rw-r--r-- | src/medsrv/main.c | 2 | ||||
-rw-r--r-- | src/openac/openac.c | 2 | ||||
-rw-r--r-- | src/pki/pki.c | 2 | ||||
-rw-r--r-- | src/scepclient/scepclient.c | 2 | ||||
-rw-r--r-- | src/starter/netkey.c | 2 |
25 files changed, 33 insertions, 37 deletions
diff --git a/scripts/crypt_burn.c b/scripts/crypt_burn.c index 9633568cd..8101f9cbd 100644 --- a/scripts/crypt_burn.c +++ b/scripts/crypt_burn.c @@ -27,7 +27,7 @@ int main(int argc, char *argv[]) library_init(NULL); - lib->plugins->load(lib->plugins, NULL, PLUGINS); + lib->plugins->load(lib->plugins, PLUGINS); atexit(library_deinit); printf("loaded: %s\n", PLUGINS); diff --git a/scripts/dh_speed.c b/scripts/dh_speed.c index 588807597..dc0a2870f 100644 --- a/scripts/dh_speed.c +++ b/scripts/dh_speed.c @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) } library_init(NULL); - lib->plugins->load(lib->plugins, NULL, argv[1]); + lib->plugins->load(lib->plugins, argv[1]); atexit(library_deinit); rounds = atoi(argv[2]); diff --git a/scripts/dnssec.c b/scripts/dnssec.c index 315a14618..0cddfc47e 100644 --- a/scripts/dnssec.c +++ b/scripts/dnssec.c @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) dbg = dbg_dnssec; - if (!lib->plugins->load(lib->plugins, NULL, PLUGINS)) + if (!lib->plugins->load(lib->plugins, PLUGINS)) { return 1; } diff --git a/scripts/fetch.c b/scripts/fetch.c index 23f857246..f58b37f89 100644 --- a/scripts/fetch.c +++ b/scripts/fetch.c @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) library_init(NULL); atexit(library_deinit); - lib->plugins->load(lib->plugins, NULL, PLUGINS); + lib->plugins->load(lib->plugins, PLUGINS); if (argc != 3 || (!streq(argv[1], "a") && !streq(argv[1], "s"))) { diff --git a/scripts/hash_burn.c b/scripts/hash_burn.c index e616d6d5a..20e5642d4 100644 --- a/scripts/hash_burn.c +++ b/scripts/hash_burn.c @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) int limit = 0, i = 0; library_init(NULL); - lib->plugins->load(lib->plugins, NULL, PLUGINS); + lib->plugins->load(lib->plugins, PLUGINS); atexit(library_deinit); printf("loaded: %s\n", PLUGINS); diff --git a/scripts/key2keyid.c b/scripts/key2keyid.c index aba96a8c1..31f3bee82 100644 --- a/scripts/key2keyid.c +++ b/scripts/key2keyid.c @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) int read; library_init(NULL); - lib->plugins->load(lib->plugins, NULL, PLUGINS); + lib->plugins->load(lib->plugins, PLUGINS); atexit(library_deinit); read = fread(buf, 1, sizeof(buf), stdin); diff --git a/scripts/keyid2sql.c b/scripts/keyid2sql.c index 26427ab3d..6e9a1334e 100644 --- a/scripts/keyid2sql.c +++ b/scripts/keyid2sql.c @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) int read, n; library_init(NULL); - lib->plugins->load(lib->plugins, NULL, PLUGINS); + lib->plugins->load(lib->plugins, PLUGINS); atexit(library_deinit); read = fread(buf, 1, sizeof(buf), stdin); diff --git a/scripts/pubkey_speed.c b/scripts/pubkey_speed.c index 32c6e8f49..ba3ad1f5e 100644 --- a/scripts/pubkey_speed.c +++ b/scripts/pubkey_speed.c @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) } library_init(NULL); - lib->plugins->load(lib->plugins, NULL, argv[1]); + lib->plugins->load(lib->plugins, argv[1]); atexit(library_deinit); keydata = chunk_create(buf, 0); diff --git a/scripts/tls_test.c b/scripts/tls_test.c index 332f13d89..e1e8ca82b 100644 --- a/scripts/tls_test.c +++ b/scripts/tls_test.c @@ -255,7 +255,7 @@ static void init() dbg = dbg_tls; - lib->plugins->load(lib->plugins, NULL, PLUGINS); + lib->plugins->load(lib->plugins, PLUGINS); creds = mem_cred_create(); lib->credmgr->add_set(lib->credmgr, &creds->set); diff --git a/src/conftest/conftest.c b/src/conftest/conftest.c index 56d98bbe2..8d2060c66 100644 --- a/src/conftest/conftest.c +++ b/src/conftest/conftest.c @@ -509,7 +509,7 @@ int main(int argc, char *argv[]) } load_loggers(logger); - if (!lib->plugins->load(lib->plugins, NULL, + if (!lib->plugins->load(lib->plugins, conftest->test->get_str(conftest->test, "preload", ""))) { return 1; diff --git a/src/libcharon/daemon.c b/src/libcharon/daemon.c index 1ad80693a..5e3ae72b9 100644 --- a/src/libcharon/daemon.c +++ b/src/libcharon/daemon.c @@ -529,7 +529,7 @@ METHOD(daemon_t, initialize, bool, countof(features), TRUE); /* load plugins, further infrastructure may need it */ - if (!lib->plugins->load(lib->plugins, NULL, plugins)) + if (!lib->plugins->load(lib->plugins, plugins)) { return FALSE; } diff --git a/src/libhydra/plugins/attr_sql/pool.c b/src/libhydra/plugins/attr_sql/pool.c index 880af61dc..4e7c48e23 100644 --- a/src/libhydra/plugins/attr_sql/pool.c +++ b/src/libhydra/plugins/attr_sql/pool.c @@ -1260,7 +1260,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, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "pool.load", PLUGINS))) { exit(SS_RC_INITIALIZATION_FAILED); diff --git a/src/libimcv/imcv.c b/src/libimcv/imcv.c index de859011c..b52b81c42 100644 --- a/src/libimcv/imcv.c +++ b/src/libimcv/imcv.c @@ -124,7 +124,7 @@ bool libimcv_init(bool is_imv) dbg = imcv_dbg; openlog("imcv", 0, LOG_DAEMON); - if (!lib->plugins->load(lib->plugins, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "libimcv.load", "random nonce gmp pubkey x509"))) { diff --git a/src/libimcv/imv/imv_policy_manager.c b/src/libimcv/imv/imv_policy_manager.c index 7dc4c5c10..f363964a5 100644 --- a/src/libimcv/imv/imv_policy_manager.c +++ b/src/libimcv/imv/imv_policy_manager.c @@ -15,7 +15,7 @@ #include "imv_policy_manager_usage.h" #include "imv_workitem.h" - + #include <library.h> #include <utils/debug.h> @@ -251,7 +251,7 @@ int main(int argc, char *argv[]) { exit(SS_RC_LIBSTRONGSWAN_INTEGRITY); } - if (!lib->plugins->load(lib->plugins, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "imv_policy_manager.load", "sqlite"))) { @@ -285,7 +285,7 @@ int main(int argc, char *argv[]) exit(SS_RC_INITIALIZATION_FAILED); } session_id = atoi(tnc_session_id); - + /* attach IMV database */ uri = lib->settings->get_str(lib->settings, "libimcv.database", NULL); if (!uri) diff --git a/src/libimcv/plugins/imv_os/pacman.c b/src/libimcv/plugins/imv_os/pacman.c index 6e4bc1103..57cc62a08 100644 --- a/src/libimcv/plugins/imv_os/pacman.c +++ b/src/libimcv/plugins/imv_os/pacman.c @@ -470,7 +470,7 @@ int main(int argc, char *argv[]) { exit(SS_RC_LIBSTRONGSWAN_INTEGRITY); } - if (!lib->plugins->load(lib->plugins, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "attest.load", "sqlite"))) { exit(SS_RC_INITIALIZATION_FAILED); diff --git a/src/libpts/plugins/imv_attestation/attest.c b/src/libpts/plugins/imv_attestation/attest.c index 6cefb2124..4d25df3f4 100644 --- a/src/libpts/plugins/imv_attestation/attest.c +++ b/src/libpts/plugins/imv_attestation/attest.c @@ -443,7 +443,7 @@ int main(int argc, char *argv[]) { exit(SS_RC_LIBSTRONGSWAN_INTEGRITY); } - if (!lib->plugins->load(lib->plugins, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "attest.load", PLUGINS))) { exit(SS_RC_INITIALIZATION_FAILED); diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c index 025e97adb..5ed0a9b0f 100644 --- a/src/libstrongswan/plugins/plugin_loader.c +++ b/src/libstrongswan/plugins/plugin_loader.c @@ -937,17 +937,14 @@ static bool find_plugin(char *path, char *name, char *buf, char **file) } METHOD(plugin_loader_t, load_plugins, bool, - private_plugin_loader_t *this, char *default_path, char *list) + private_plugin_loader_t *this, char *list) { enumerator_t *enumerator; - char *token; + char *default_path = NULL, *token; bool critical_failed = FALSE; #ifdef PLUGINDIR - if (default_path == NULL) - { - default_path = PLUGINDIR; - } + default_path = PLUGINDIR; #endif /* PLUGINDIR */ enumerator = enumerator_create_token(list, " ", " "); diff --git a/src/libstrongswan/plugins/plugin_loader.h b/src/libstrongswan/plugins/plugin_loader.h index 15496f4c7..285b33910 100644 --- a/src/libstrongswan/plugins/plugin_loader.h +++ b/src/libstrongswan/plugins/plugin_loader.h @@ -57,25 +57,24 @@ struct plugin_loader_t { bool critical); /** - * Load a list of plugins from a directory. + * Load a list of plugins. * - * Each plugin in list may have a ending exclamation mark (!) to mark it + * Each plugin in list may have an ending exclamation mark (!) to mark it * as a critical plugin. If loading a critical plugin fails, plugin loading * is aborted and FALSE is returned. * * Additional paths can be added with add_path(), these will be searched - * for the plugins first, in the order they were added, then the given path - * or the default follow. + * for the plugins first, in the order they were added, then the default + * path follows. * * @note Even though this method could be called multiple times this is * currently not really supported in regards to plugin features and their * dependencies (in particular soft dependencies). * - * @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 */ - bool (*load)(plugin_loader_t *this, char *path, char *list); + bool (*load)(plugin_loader_t *this, char *list); /** * Add an additional search path for plugins. diff --git a/src/libstrongswan/tests/test_runner.c b/src/libstrongswan/tests/test_runner.c index 85c6b2019..2f9e4dc0a 100644 --- a/src/libstrongswan/tests/test_runner.c +++ b/src/libstrongswan/tests/test_runner.c @@ -40,7 +40,7 @@ static bool load_plugins() } enumerator->destroy(enumerator); - return lib->plugins->load(lib->plugins, NULL, PLUGINS); + return lib->plugins->load(lib->plugins, PLUGINS); } int main() diff --git a/src/manager/main.c b/src/manager/main.c index 15ed38154..66a4384cc 100644 --- a/src/manager/main.c +++ b/src/manager/main.c @@ -35,7 +35,7 @@ int main (int arc, char *argv[]) int threads, timeout; library_init(NULL); - if (!lib->plugins->load(lib->plugins, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "manager.load", PLUGINS))) { return 1; diff --git a/src/medsrv/main.c b/src/medsrv/main.c index 03b135289..cbba72872 100644 --- a/src/medsrv/main.c +++ b/src/medsrv/main.c @@ -34,7 +34,7 @@ int main(int arc, char *argv[]) int timeout, threads; library_init(NULL); - if (!lib->plugins->load(lib->plugins, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "medsrv.load", PLUGINS))) { return 1; diff --git a/src/openac/openac.c b/src/openac/openac.c index 7b81d6cea..7074d44be 100644 --- a/src/openac/openac.c +++ b/src/openac/openac.c @@ -238,7 +238,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, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "openac.load", PLUGINS))) { exit(SS_RC_INITIALIZATION_FAILED); diff --git a/src/pki/pki.c b/src/pki/pki.c index 429517b92..c3039a649 100644 --- a/src/pki/pki.c +++ b/src/pki/pki.c @@ -167,7 +167,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, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "pki.load", PLUGINS))) { exit(SS_RC_INITIALIZATION_FAILED); diff --git a/src/scepclient/scepclient.c b/src/scepclient/scepclient.c index 11174c96f..1267370ba 100644 --- a/src/scepclient/scepclient.c +++ b/src/scepclient/scepclient.c @@ -924,7 +924,7 @@ int main(int argc, char **argv) init_log("scepclient"); /* load plugins, further infrastructure may need it */ - if (!lib->plugins->load(lib->plugins, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "scepclient.load", PLUGINS))) { exit_scepclient("plugin loading failed"); diff --git a/src/starter/netkey.c b/src/starter/netkey.c index 921a220db..2b500bab4 100644 --- a/src/starter/netkey.c +++ b/src/starter/netkey.c @@ -58,7 +58,7 @@ bool starter_netkey_init(void) void starter_netkey_cleanup(void) { - if (!lib->plugins->load(lib->plugins, NULL, + if (!lib->plugins->load(lib->plugins, lib->settings->get_str(lib->settings, "starter.load", PLUGINS))) { DBG1(DBG_APP, "unable to load kernel plugins"); |