From 9a8640183c031ece7742fd58d8c7927863c96cf7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 9 Nov 2017 15:08:16 +0100 Subject: [PATCH] plugin: use RTLD_LOCAL instead of RTLD_GLOBAL when loading library MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit RTLD_GLOBAL was used to allow plugins use each other symbols but this facility was (most likely) never used and is a bad design anyway. If there is a common code it should just go to a library. Using RTLD_LOCAL on the other hand saves us from conflicting symbols used by different plugins. An example can be iwinfo plugin using libnl. If there appears to be another plugin using incompatible netlink implementation this will result in a problem. Both plugins will start using the same libnl which will break one of them. Signed-off-by: Rafał Miłecki Acked-by: Jo-Philipp Wich --- plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.c b/plugin.c index 70d2c56..532fa15 100644 --- a/plugin.c +++ b/plugin.c @@ -412,7 +412,7 @@ rpc_plugin_register_library(struct ubus_context *ctx, const char *path) struct rpc_plugin *p; void *dlh; - dlh = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); + dlh = dlopen(path, RTLD_LAZY | RTLD_LOCAL); if (!dlh) return UBUS_STATUS_UNKNOWN_ERROR; -- 2.25.1