plugin-loader: Removed unused path argument of load() method
Multiple additional search paths can be added with the add_path() method.
This commit is contained in:
parent
9da142b4dc
commit
b18a531715
|
@ -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);
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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")))
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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")))
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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, " ", " ");
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue