From 0b431b8a17fc8f2c66684b5d0bb428b7b8d85051 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 4 Jul 2006 19:40:27 +0000 Subject: [PATCH] Use RTLD_GLOBAL when loading shared libraries. --- WHATS_NEW | 1 + lib/misc/sharedlib.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 0aea83918..fa8278d07 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.07 - ================================= + Use RTLD_GLOBAL when loading shared libraries. Add some forgotten memlock checks to _vg_read to protect against full scans. Add mutex to dmeventd_mirror to avoid concurrent execution. Fix vgreduce --removemissing to return success if VG is already consistent. diff --git a/lib/misc/sharedlib.c b/lib/misc/sharedlib.c index 96d90a8f1..098a7a5e7 100644 --- a/lib/misc/sharedlib.c +++ b/lib/misc/sharedlib.c @@ -47,13 +47,13 @@ void *load_shared_library(struct cmd_context *cmd, const char *libname, log_very_verbose("Opening shared %s library %s", desc, path); - if (!(library = dlopen(path, RTLD_LAZY))) { + if (!(library = dlopen(path, RTLD_LAZY | RTLD_GLOBAL))) { if (silent && ignorelockingfailure()) log_verbose("Unable to open external %s library %s", desc, path); else - log_error("Unable to open external %s library %s", - desc, path); + log_error("Unable to open external %s library %s: %s", + desc, path, dlerror()); } return library;