diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-09-29 19:49:51 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-10-03 10:09:24 +0000 |
commit | 2777003e121a5d764b54c62590e7ceb46ae2c157 (patch) | |
tree | 1ca9471c447c0fcf94640328fd1a3207224615ad /wsutil/filesystem.c | |
parent | d477ea35a946c2935974edb3fea45cf23513a03c (diff) |
Add version check for plugin compatibility
Only plugins built for the same feature release (X.Y) are assured binary
compatibility. Make sure we don't try to run unsuitable code and, if so,
warn the user. This might happen for example if the user manually copies
a binary plugin to the wrong folder, intentionally or by accident.
I'm using "release version" to loosely mean not a patch release
(i.e: a feature release).
Change-Id: I896e9cbbd2d3843623fff6af8ef51002ec06f1f8
Reviewed-on: https://code.wireshark.org/review/23807
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/filesystem.c')
-rw-r--r-- | wsutil/filesystem.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index ce1eca773b..8f0a3ead2d 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -1066,8 +1066,7 @@ get_plugins_dir_with_version(void) if (!plugin_dir) init_plugin_dir(); if (plugin_dir && !plugin_dir_with_version) - plugin_dir_with_version = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%d.%d", - plugin_dir, VERSION_MAJOR, VERSION_MINOR); + plugin_dir_with_version = g_build_filename(plugin_dir, VERSION_RELEASE, (gchar *)NULL); return plugin_dir_with_version; } @@ -1086,8 +1085,7 @@ get_plugins_pers_dir_with_version(void) if (!plugin_pers_dir) init_plugin_pers_dir(); if (plugin_pers_dir && !plugin_pers_dir_with_version) - plugin_pers_dir_with_version = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%d.%d", - plugin_pers_dir, VERSION_MAJOR, VERSION_MINOR); + plugin_pers_dir_with_version = g_build_filename(plugin_pers_dir, VERSION_RELEASE, (gchar *)NULL); return plugin_pers_dir_with_version; } |