summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/plugin_loader.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2015-11-18 14:49:27 +0100
committerYves-Alexis Perez <corsac@debian.org>2015-11-18 14:49:27 +0100
commit1e980d6be0ef0e243c6fe82b5e855454b97e24a4 (patch)
tree0d59eec2ce2ed332434ae80fc78a44db9ad293c5 /src/libstrongswan/plugins/plugin_loader.c
parent5dca9ea0e2931f0e2a056c7964d311bcc30a01b8 (diff)
downloadvyos-strongswan-1e980d6be0ef0e243c6fe82b5e855454b97e24a4.tar.gz
vyos-strongswan-1e980d6be0ef0e243c6fe82b5e855454b97e24a4.zip
Imported Upstream version 5.3.4
Diffstat (limited to 'src/libstrongswan/plugins/plugin_loader.c')
-rw-r--r--src/libstrongswan/plugins/plugin_loader.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c
index f7ac347d2..01d0495be 100644
--- a/src/libstrongswan/plugins/plugin_loader.c
+++ b/src/libstrongswan/plugins/plugin_loader.c
@@ -356,6 +356,7 @@ static plugin_entry_t *load_plugin(private_plugin_loader_t *this, char *name,
{
plugin_entry_t *entry;
void *handle;
+ int flag = RTLD_LAZY;
switch (create_plugin(this, RTLD_DEFAULT, name, FALSE, critical, &entry))
{
@@ -380,15 +381,19 @@ static plugin_entry_t *load_plugin(private_plugin_loader_t *this, char *name,
return NULL;
}
}
- handle = dlopen(file, RTLD_LAZY
+ if (lib->settings->get_bool(lib->settings, "%s.dlopen_use_rtld_now",
+ lib->ns, FALSE))
+ {
+ flag = RTLD_NOW;
+ }
#ifdef RTLD_NODELETE
- /* if supported, do not unload library when unloading a plugin. It really
- * doesn't matter in productive systems, but causes many (dependency)
- * library reloads during unit tests. Some libraries can't handle that,
+ /* If supported, do not unload the library when unloading a plugin. It
+ * really doesn't matter in productive systems, but causes many (dependency)
+ * library reloads during unit tests. Some libraries can't handle that, e.g.
* GnuTLS leaks file descriptors in its library load/unload functions. */
- | RTLD_NODELETE
+ flag |= RTLD_NODELETE;
#endif
- );
+ handle = dlopen(file, flag);
if (handle == NULL)
{
DBG1(DBG_LIB, "plugin '%s' failed to load: %s", name, dlerror());