summaryrefslogtreecommitdiff
path: root/wsutil/filesystem.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-03-24 23:04:57 +0100
committerAnders Broman <a.broman58@gmail.com>2015-03-25 05:08:02 +0000
commit786a7ea42c6bcfd44f80c258bc44940e6021133f (patch)
treee2f179540bf0b9a5828c8d27086226fa3a91f072 /wsutil/filesystem.c
parent9a9413f9f4793125917d0e49fcb88d55001685c6 (diff)
downloadwireshark-786a7ea42c6bcfd44f80c258bc44940e6021133f.tar.gz
Add support for WIRESHARK_EXTCAP_DIR environment variable on Windows
This can be useful when a user cannot modify the Wireshark installation folder (due to UAC restriction for example) This is already supported on Linux / OSX Change-Id: Icfcb43908de1fd8cd415cd31a98219eab1c757c8 Reviewed-on: https://code.wireshark.org/review/7809 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wsutil/filesystem.c')
-rw-r--r--wsutil/filesystem.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c
index 7b5eee83d8..f23c19325a 100644
--- a/wsutil/filesystem.c
+++ b/wsutil/filesystem.c
@@ -1057,6 +1057,8 @@ static const char *extcap_dir = NULL;
static void init_extcap_dir(void) {
#ifdef _WIN32
+ char *alt_extcap_path;
+
/*
* On Windows, the data file directory is the installation
* directory; the extcap hooks are stored under it.
@@ -1065,7 +1067,15 @@ static void init_extcap_dir(void) {
* on Windows, the data file directory is the directory
* in which the Wireshark binary resides.
*/
- extcap_dir = g_strdup_printf("%s\\extcap", get_datafile_dir());
+ alt_extcap_path = getenv_utf8("WIRESHARK_EXTCAP_DIR");
+ if (alt_extcap_path) {
+ /*
+ * The user specified a different directory for extcap hooks.
+ */
+ extcap_dir = g_strdup(alt_extcap_path);
+ } else {
+ extcap_dir = g_strdup_printf("%s\\extcap", get_datafile_dir());
+ }
#else
if (running_in_build_directory_flag) {
/*