libtnccs: Optionally use RTLD_NOW to load IMC/IMVs with dlopen()
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user