aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2017-09-12 10:51:46 +0100
committerJoão Valverde <j@v6e.pt>2017-09-17 16:54:52 +0000
commit978f6b4e1a94c831fa90421b6127e14f6ec9de17 (patch)
treeaba671099f01aebd99c85131e6b32c52da1a1931 /wsutil
parente8e8b0d0b46941f79535c020f5464c372d0138a7 (diff)
plugins: Fix paths to match WSUG
The Wireshark User Guide seems to say: Global lua plugins are in $pkglibdir/plugins Personal lua plugins are in XDG_CONFIG_HOME/plugins Global binary plugins are in $pkglibdir/plugins/$version Personal binary plugins are in XDG_CONFIG_HOME/plugins/$version Fix code to match that. This is a backward-incompatible change for global lua plugins and personal binary plugins. Adds a version subfolder to the personal plugin folder for binary plugins. This allows for safe upgrades and side-by-side installations with different prefixes (they no longer use the same personal dir). Change-Id: Ie0f039113628a257625a9a9fb2cb30e532f5dd47 Reviewed-on: https://code.wireshark.org/review/23516 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/CMakeLists.txt4
-rw-r--r--wsutil/Makefile.am2
-rw-r--r--wsutil/filesystem.c4
-rw-r--r--wsutil/plugins.c10
4 files changed, 15 insertions, 5 deletions
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt
index 9bf2b6c30b..43a574d678 100644
--- a/wsutil/CMakeLists.txt
+++ b/wsutil/CMakeLists.txt
@@ -21,6 +21,10 @@
include(UseABICheck)
+if(NOT WIN32)
+ add_definitions(-DPLUGIN_DIR=\"${CMAKE_INSTALL_FULL_LIBDIR}/wireshark/plugins\")
+endif()
+
set(WSUTIL_PUBLIC_HEADERS
adler32.h
base32.h
diff --git a/wsutil/Makefile.am b/wsutil/Makefile.am
index 9f50e9b6c9..e6698ea4fb 100644
--- a/wsutil/Makefile.am
+++ b/wsutil/Makefile.am
@@ -24,7 +24,7 @@ AM_CPPFLAGS = $(INCLUDEDIRS) $(WS_CPPFLAGS) -DWS_BUILD_DLL \
-DTOP_SRCDIR=\"$(abs_top_srcdir)\" \
-DDATAFILE_DIR=\"$(pkgdatadir)\" \
-DEXTCAP_DIR=\"$(extcapdir)\" \
- -DPLUGIN_INSTALL_DIR=\"$(plugindir)\" \
+ -DPLUGIN_DIR=\"$(pkglibdir)/plugins\" \
-DJSMN_STRICT \
$(GLIB_CFLAGS) $(LIBGCRYPT_CFLAGS) \
$(LIBGNUTLS_CFLAGS)
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c
index a4e5ff075f..4ab725377d 100644
--- a/wsutil/filesystem.c
+++ b/wsutil/filesystem.c
@@ -955,7 +955,7 @@ get_datafile_dir(void)
* otherwise, if we're running from an app bundle in macOS, we
* use the Contents/PlugIns/wireshark subdirectory of the app bundle;
*
- * otherwise, we use the PLUGIN_INSTALL_DIR value supplied by the
+ * otherwise, we use the PLUGIN_DIR value supplied by the
* configure script.
*/
static char *plugin_dir = NULL;
@@ -1028,7 +1028,7 @@ init_plugin_dir(void)
}
#endif
else {
- plugin_dir = g_strdup(PLUGIN_INSTALL_DIR);
+ plugin_dir = g_strdup(PLUGIN_DIR);
}
}
#endif
diff --git a/wsutil/plugins.c b/wsutil/plugins.c
index 047a6cb721..f251966e31 100644
--- a/wsutil/plugins.c
+++ b/wsutil/plugins.c
@@ -340,7 +340,11 @@ scan_plugins(plugin_load_failure_mode mode)
}
}
else
- plugins_scan_dir(plugin_dir, mode);
+ {
+ plugin_dir_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_plugin_dir(), VERSION);
+ plugins_scan_dir(plugin_dir_path, mode);
+ g_free(plugin_dir_path);
+ }
/*
* If the program wasn't started with special privileges,
@@ -352,7 +356,9 @@ scan_plugins(plugin_load_failure_mode mode)
*/
if (!started_with_special_privs())
{
- plugins_scan_dir(get_plugins_pers_dir(), mode);
+ plugin_dir_path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_plugins_pers_dir(), VERSION);
+ plugins_scan_dir(plugin_dir_path, mode);
+ g_free(plugin_dir_path);
}
}
}