aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/plugin.c
diff options
context:
space:
mode:
authorChristian Hesse2017-01-25 21:19:47 +0100
committerDavid Sommerseth2017-01-25 22:13:38 +0100
commit05baa0ecf841852fbf29ef39ee9cd1d4cac990cf (patch)
treeb38d07d16ecbe0541a676ff6474f21a5cf1d6310 /src/openvpn/plugin.c
parentba3ccaf92d379f8a2efad80cee7dc2806088f421 (diff)
downloadopenvpn-05baa0ecf841852fbf29ef39ee9cd1d4cac990cf.zip
openvpn-05baa0ecf841852fbf29ef39ee9cd1d4cac990cf.tar.gz
Clean up plugin path handling
Drop --with-plugindir, instead use an environment variable PLUGINDIR to specify the plugin directory. This puts a define into include/openvpn-plugin.h.in which has the plugin directory. The configure script does not know about the final plugin path. Thus we have to make Make generate the final header file for us. As the path is always available remove the compile time condition (and dead code) from src/openvpn/plugin.c. v2: The configure script can not evaluate the final $libdir path. So use make to create a header file on the containing the final path. v3: Fix whitespace errors and gitignore location. v4: No extra header file, generate src/openvpn/plugin.h on the fly. Remove condition and dead code. v5: Move the define to include/openvpn-plugin.h.in and let make generate the final header file. Signed-off-by: Christian Hesse <mail@eworm.de> Acked-by: David Sommerseth <davids@openvpn.net> Message-Id: <20170125201947.17197-1-list@eworm.de> URL: http://www.mail-archive.com/search?l=mid&q=20170125201947.17197-1-list@eworm.de Signed-off-by: David Sommerseth <davids@openvpn.net> (cherry picked from commit 4590c3831d0400096fab08aa1ed7f909da870ced)
Diffstat (limited to 'src/openvpn/plugin.c')
-rw-r--r--src/openvpn/plugin.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/openvpn/plugin.c b/src/openvpn/plugin.c
index e530c0c..f777027 100644
--- a/src/openvpn/plugin.c
+++ b/src/openvpn/plugin.c
@@ -234,23 +234,15 @@ plugin_init_item(struct plugin *p, const struct plugin_option *o)
#ifndef _WIN32
p->handle = NULL;
-#if defined(PLUGIN_LIBDIR)
+
if (!absolute_pathname(p->so_pathname))
{
char full[PATH_MAX];
openvpn_snprintf(full, sizeof(full), "%s/%s", PLUGIN_LIBDIR, p->so_pathname);
p->handle = dlopen(full, RTLD_NOW);
-#if defined(ENABLE_PLUGIN_SEARCH)
- if (!p->handle)
- {
- rel = true;
- p->handle = dlopen(p->so_pathname, RTLD_NOW);
- }
-#endif
}
else
-#endif
{
rel = !absolute_pathname(p->so_pathname);
p->handle = dlopen(p->so_pathname, RTLD_NOW);