]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
libtnccs: Optionally use RTLD_NOW to load IMC/IMVs with dlopen()
authorTobias Brunner <tobias@strongswan.org>
Fri, 25 Sep 2015 10:00:58 +0000 (12:00 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 9 Nov 2015 13:37:08 +0000 (14:37 +0100)
conf/options/charon.opt
src/libtnccs/plugins/tnc_imc/tnc_imc.c
src/libtnccs/plugins/tnc_imv/tnc_imv.c

index 808e368b67bc004099f7ea372799571b5e76755a..816f3250c4e965d5f8f7452903cdac754ada0fc8 100644 (file)
@@ -66,8 +66,8 @@ charon.dh_exponent_ansi_x9_42 = yes
        strength.
 
 charon.dlopen_use_rtld_now = no
-       Use RTLD_NOW with dlopen when loading plugins to reveal missing symbols
-       immediately.
+       Use RTLD_NOW with dlopen when loading plugins and IMV/IMCs to reveal missing
+       symbols immediately.
 
 charon.dns1
        DNS server assigned to peer via configuration payload (CP).
index 623da7f62794451d3de873c5c4639402de2d6b79..822df3f27769bb5dd760765c08d13291a9d2fa47 100644 (file)
@@ -349,10 +349,16 @@ static private_tnc_imc_t* tnc_imc_create_empty(char *name)
 imc_t* tnc_imc_create(char *name, char *path)
 {
        private_tnc_imc_t *this;
+       int flag = RTLD_LAZY;
 
        this = tnc_imc_create_empty(name);
 
-       this->handle = dlopen(path, RTLD_LAZY);
+       if (lib->settings->get_bool(lib->settings, "%s.dlopen_use_rtld_now",
+                                                               lib->ns, FALSE))
+       {
+               flag = RTLD_NOW;
+       }
+       this->handle = dlopen(path, flag);
        if (!this->handle)
        {
                DBG1(DBG_TNC, "IMC \"%s\" failed to load: %s", name, dlerror());
index 039f1fcf1be80b6bd0cebbd3320b18a580df74df..9a03041721e932f89d47773529a2583b874acce4 100644 (file)
@@ -345,10 +345,16 @@ static private_tnc_imv_t* tnc_imv_create_empty(char *name)
 imv_t* tnc_imv_create(char *name, char *path)
 {
        private_tnc_imv_t *this;
+       int flag = RTLD_LAZY;
 
        this = tnc_imv_create_empty(name);
 
-       this->handle = dlopen(path, RTLD_LAZY);
+       if (lib->settings->get_bool(lib->settings, "%s.dlopen_use_rtld_now",
+                                                               lib->ns, FALSE))
+       {
+               flag = RTLD_NOW;
+       }
+       this->handle = dlopen(path, flag);
        if (!this->handle)
        {
                DBG1(DBG_TNC, "IMV \"%s\" failed to load: %s", name, dlerror());