From a9ac012fa8838fea9b611f590fd022e29ceac20e Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Fri, 24 May 2019 22:50:20 +0200 Subject: [PATCH] tshark: fix some paths --- root-packages/tshark/build.sh | 1 + root-packages/tshark/paths.patch | 76 ++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 root-packages/tshark/paths.patch diff --git a/root-packages/tshark/build.sh b/root-packages/tshark/build.sh index cdfb9818d..2a736aa23 100644 --- a/root-packages/tshark/build.sh +++ b/root-packages/tshark/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Network protocol analyzer and sniffer" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="Auxilus @Auxilus" TERMUX_PKG_VERSION=3.0.1 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://www.wireshark.org/download/src/all-versions/wireshark-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=86864c3d0f6c2311992a98d8ea7dfd429097fe62dae2e5516e1a2f6bef2ac08c TERMUX_PKG_DEPENDS="glib, libgpg-error, libgcrypt, libnl, libpcap, libgnutls, openssl, libiconv" diff --git a/root-packages/tshark/paths.patch b/root-packages/tshark/paths.patch new file mode 100644 index 000000000..90f59af08 --- /dev/null +++ b/root-packages/tshark/paths.patch @@ -0,0 +1,76 @@ +diff -u -r ./caputils/ws80211_utils.c ../src.orig/caputils/ws80211_utils.c +--- ../src.orig/caputils/ws80211_utils.c 2019-05-24 19:55:35.079986585 +0200 ++++ ./caputils/ws80211_utils.c 2019-05-24 20:07:54.523314540 +0200 +@@ -915,7 +915,7 @@ + return -1; + } + +-const char *network_manager_path = "/usr/sbin/NetworkManager"; /* Is this correct? */ ++const char *network_manager_path = "@TERMUX_PREFIX@/bin/NetworkManager"; /* Is this correct? */ + const char *ws80211_get_helper_path(void) { + if (g_file_test(network_manager_path, G_FILE_TEST_IS_EXECUTABLE)) { + return network_manager_path; +diff -u -r ./epan/dissectors/packet-snort.c ../src.orig/epan/dissectors/packet-snort.c +--- ../src.orig/epan/dissectors/packet-snort.c 2019-05-24 19:55:37.506653234 +0200 ++++ ./epan/dissectors/packet-snort.c 2019-05-24 19:58:06.739985483 +0200 +@@ -115,8 +115,8 @@ + + /* Snort binary and config file */ + #ifndef _WIN32 +-static const char *pref_snort_binary_filename = "/usr/sbin/snort"; +-static const char *pref_snort_config_filename = "/etc/snort/snort.conf"; ++static const char *pref_snort_binary_filename = "@TERMUX_PREFIX@/sbin/snort"; ++static const char *pref_snort_config_filename = "@TERMUX_PREFIX@/etc/snort/snort.conf"; + #else + /* Default locations from Snort Windows installer */ + static const char *pref_snort_binary_filename = "C:\\Snort\\bin\\snort.exe"; +diff -u -r ./epan/maxmind_db.c ../src.orig/epan/maxmind_db.c +--- ../src.orig/epan/maxmind_db.c 2019-05-24 19:55:38.339986562 +0200 ++++ ./epan/maxmind_db.c 2019-05-24 19:56:21.946652912 +0200 +@@ -86,8 +86,8 @@ + { "C:\\ProgramData\\GeoIP" }, + { "C:\\GeoIP" }, + #else +- { "/usr/share/GeoIP" }, +- { "/var/lib/GeoIP" }, ++ { "@TERMUX_PREFIX@/share/GeoIP" }, ++ { "@TERMUX_PREFIX@/var/lib/GeoIP" }, + #endif + { NULL } + }; +diff -u -r ./epan/oids.c ../src.orig/epan/oids.c +--- ../src.orig/epan/oids.c 2019-05-24 19:55:38.343319895 +0200 ++++ ./epan/oids.c 2019-05-24 19:59:00.456651758 +0200 +@@ -1275,7 +1275,7 @@ + g_string_append_printf(path_str, "%s", path); + g_free (path); + #else +- g_string_append(path_str, "/usr/share/snmp/mibs"); ++ g_string_append(path_str, "@TERMUX_PREFIX@/share/snmp/mibs"); + if (!smi_init_done) + smiInit(NULL); + path = smiGetPath(); +diff -u -r ./tools/lemon/lemon.c ../src.orig/tools/lemon/lemon.c +--- ../src.orig/tools/lemon/lemon.c 2019-05-24 19:55:35.359986584 +0200 ++++ ./tools/lemon/lemon.c 2019-05-24 19:59:39.699984806 +0200 +@@ -3414,7 +3414,7 @@ + *cp = c; + }else{ + pathlist = getenv("PATH"); +- if( pathlist==0 ) pathlist = ".:/bin:/usr/bin"; ++ if( pathlist==0 ) pathlist = ".:@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets"; + pathbuf = (char *) malloc( lemonStrlen(pathlist) + 1 ); + path = (char *)malloc( lemonStrlen(pathlist)+lemonStrlen(name)+2 ); + MemoryCheck(pathbuf); MemoryCheck(path); /* Fail on allocation failure. */ +diff -u -r ./wsutil/filesystem.c ../src.orig/wsutil/filesystem.c +--- ../src.orig/wsutil/filesystem.c 2019-05-24 19:55:38.793319892 +0200 ++++ ./wsutil/filesystem.c 2019-05-24 20:02:00.729983781 +0200 +@@ -1138,7 +1138,7 @@ + #ifdef _WIN32 + return get_datafile_dir(); + #else +- return "/etc"; ++ return "@TERMUX_PREFIX@/etc"; + #endif + } +