diff --git a/wireshark-0002-Customize-permission-denied-error.patch b/wireshark-0002-Customize-permission-denied-error.patch index cad4663..0b07ae0 100644 --- a/wireshark-0002-Customize-permission-denied-error.patch +++ b/wireshark-0002-Customize-permission-denied-error.patch @@ -8,10 +8,10 @@ because of permissions. Signed-off-by: Jan Safranek diff --git a/capture/capture_sync.c b/capture/capture_sync.c -index 2f9d2cc..b18e47f 100644 +index 47a30a70c4..84d19568b0 100644 --- a/capture/capture_sync.c +++ b/capture/capture_sync.c -@@ -375,6 +375,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi +@@ -336,6 +336,7 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments, gchar *signal_pipe_name; #else char errmsg[1024+1]; @@ -19,21 +19,20 @@ index 2f9d2cc..b18e47f 100644 int sync_pipe[2]; /* pipe used to send messages from child to parent */ enum PIPES { PIPE_READ, PIPE_WRITE }; /* Constants 0 and 1 for PIPE_READ and PIPE_WRITE */ #endif -@@ -728,8 +729,11 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi +@@ -741,8 +742,10 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments, dup2(sync_pipe[PIPE_WRITE], 2); ws_close(sync_pipe[PIPE_READ]); execv(argv[0], argv); -- g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s", +- snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s", - argv[0], g_strerror(errno)); + if (errno == EPERM || errno == EACCES) -+ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root."; -+ g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s", -+ argv[0], g_strerror(errno), securitymsg); -+ ++ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root."; ++ snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s", ++ argv[0], g_strerror(errno), securitymsg); sync_pipe_errmsg_to_parent(2, errmsg, ""); /* Exit with "_exit()", so that we don't close the connection -@@ -826,6 +830,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd, +@@ -846,6 +849,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd, int i; #else char errmsg[1024+1]; @@ -41,16 +40,15 @@ index 2f9d2cc..b18e47f 100644 int sync_pipe[2]; /* pipe used to send messages from child to parent */ int data_pipe[2]; /* pipe used to send data from child to parent */ #endif -@@ -1003,8 +1008,11 @@ sync_pipe_open_command(char** argv, int *data_read_fd, +@@ -994,8 +998,10 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd, ws_close(sync_pipe[PIPE_READ]); ws_close(sync_pipe[PIPE_WRITE]); execv(argv[0], argv); -- g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s", +- snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s", - argv[0], g_strerror(errno)); -+ execv(argv[0], (gpointer)argv); -+ if (errno == EPERM || errno == EACCES) -+ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root."; -+ g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s", ++ if (errno == EPERM || errno == EACCES) ++ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root."; ++ snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s", + argv[0], g_strerror(errno), securitymsg); sync_pipe_errmsg_to_parent(2, errmsg, ""); diff --git a/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch b/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch index 8277a8c..b71f99c 100644 --- a/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch +++ b/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch @@ -4,10 +4,10 @@ Subject: [PATCH] fix string overrun in plugins/profinet diff --git a/plugins/epan/profinet/packet-dcom-cba.c b/plugins/epan/profinet/packet-dcom-cba.c -index 0f1658a..f7fd322 100644 +index 52c5017e1f..fb980269db 100644 --- a/plugins/epan/profinet/packet-dcom-cba.c +++ b/plugins/epan/profinet/packet-dcom-cba.c -@@ -555,7 +555,7 @@ dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst(tvbuff_t *tvb, int offset, +@@ -543,7 +543,7 @@ dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { guint32 u32Pointer; diff --git a/wireshark-0004-Restore-Fedora-specific-groups.patch b/wireshark-0004-Restore-Fedora-specific-groups.patch index 4ec1140..53e62dc 100644 --- a/wireshark-0004-Restore-Fedora-specific-groups.patch +++ b/wireshark-0004-Restore-Fedora-specific-groups.patch @@ -3,10 +3,10 @@ Date: Fri, 13 Sep 2013 14:36:55 +0400 Subject: [PATCH] Restore Fedora-specific groups Signed-off-by: Peter Lemenkov -diff --git a/org.wireshark.Wireshark.desktop b/org.wireshark.Wireshark.desktop -index 334db48..669c6f1 100644 ---- a/org.wireshark.Wireshark.desktop -+++ b/org.wireshark.Wireshark.desktop +diff --git a/resources/freedesktop/org.wireshark.Wireshark.desktop b/resources/freedesktop/org.wireshark.Wireshark.desktop +index a880a50a33..a25d67d99b 100644 +--- a/resources/freedesktop/org.wireshark.Wireshark.desktop ++++ b/resources/freedesktop/org.wireshark.Wireshark.desktop @@ -108,4 +108,4 @@ Terminal=false MimeType=application/vnd.tcpdump.pcap;application/x-pcapng;application/x-snoop;application/x-iptrace;application/x-lanalyzer;application/x-nettl;application/x-radcom;application/x-etherpeek;application/x-visualnetworks;application/x-netinstobserver;application/x-5view;application/x-tektronix-rf5;application/x-micropross-mplog;application/x-apple-packetlogger;application/x-endace-erf;application/ipfix;application/x-ixia-vwr; # Category entry according to: diff --git a/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch b/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch index e2c5b99..325afe2 100644 --- a/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch +++ b/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch @@ -3,10 +3,10 @@ Date: Wed, 29 Jan 2014 16:04:12 +0400 Subject: [PATCH] Fix paths in a org.wireshark.Wireshark.desktop file -diff --git a/org.wireshark.Wireshark.desktop b/org.wireshark.Wireshark.desktop -index 669c6f1..f7df1f3 100644 ---- a/org.wireshark.Wireshark.desktop -+++ b/org.wireshark.Wireshark.desktop +diff --git a/resources/freedesktop/org.wireshark.Wireshark.desktop b/resources/freedesktop/org.wireshark.Wireshark.desktop +index a880a50a33..54b3595d55 100644 +--- a/resources/freedesktop/org.wireshark.Wireshark.desktop ++++ b/resources/freedesktop/org.wireshark.Wireshark.desktop @@ -102,8 +102,8 @@ Comment[tr]=Ağ trafiği çözümleyicisi Comment[vi]=Trình phân tích giao thông mạng Comment[uk]=Аналізатор мережевого трафіку diff --git a/wireshark-0006-Move-tmp-to-var-tmp.patch b/wireshark-0006-Move-tmp-to-var-tmp.patch index 268cbaf..2c1ab0d 100644 --- a/wireshark-0006-Move-tmp-to-var-tmp.patch +++ b/wireshark-0006-Move-tmp-to-var-tmp.patch @@ -5,45 +5,45 @@ Subject: [PATCH] Move /tmp to /var/tmp Fedora is using tmpfs which is limited by the size of RAM, thus we need to use different directory on different filesystem. + --- ui/qt/about_dialog.cpp | 3 +- - ui/qt/iax2_analysis_dialog.cpp | 5 +-- - ui/qt/rtp_analysis_dialog.cpp | 5 +-- - ui/qt/rtp_audio_stream.cpp | 3 +- - wsutil/tempfile.c | 9 +++--- - wsutil/tempfile.h | 4 +-- - wsutil/wstmpdir.c | 70 ++++++++++++++++++++++++++++++++++++++++++ - wsutil/wstmpdir.h | 39 +++++++++++++++++++++++ - 8 files changed, 132 insertions(+), 11 deletions(-) + ui/qt/iax2_analysis_dialog.cpp | 5 ++- + ui/qt/utils/rtp_audio_file.cpp | 3 +- + wsutil/tempfile.c | 18 +++++++- + wsutil/tempfile.h | 2 +- + wsutil/wstmpdir.c | 71 ++++++++++++++++++++++++++++++++++ + wsutil/wstmpdir.h | 39 +++++++++++++++++++ + 7 files changed, 134 insertions(+), 7 deletions(-) create mode 100644 wsutil/wstmpdir.c create mode 100644 wsutil/wstmpdir.h diff --git a/ui/qt/about_dialog.cpp b/ui/qt/about_dialog.cpp -index 31dc581..2f74285 100644 +index 752b669ac4..42c2be0fca 100644 --- a/ui/qt/about_dialog.cpp +++ b/ui/qt/about_dialog.cpp -@@ -26,6 +26,7 @@ +@@ -14,6 +14,7 @@ - #include "wireshark_application.h" + #include "main_application.h" #include +#include /* for get_tmp_dir() */ #include #include -@@ -206,7 +206,7 @@ FolderListModel::FolderListModel(QObject * parent): +@@ -185,7 +186,7 @@ FolderListModel::FolderListModel(QObject * parent): appendRow(QStringList() << tr("\"File\" dialogs") << get_last_open_dir() << tr("capture files")); /* temp */ -- appendRow(QStringList() << tr("Temp") << g_get_tmp_dir() << tr("untitled capture files")); -+ appendRow(QStringList() << tr("Temp") << get_tmp_dir() << tr("untitled capture files")); +- appendRow(QStringList() << tr("Temp") << (global_capture_opts.temp_dir && global_capture_opts.temp_dir[0] ? global_capture_opts.temp_dir : g_get_tmp_dir()) << tr("untitled capture files")); ++ appendRow(QStringList() << tr("Temp") << (global_capture_opts.temp_dir && global_capture_opts.temp_dir[0] ? global_capture_opts.temp_dir : get_tmp_dir()) << tr("untitled capture files")); /* pers conf */ appendRow(QStringList() << tr("Personal configuration") diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp -index ee4e5fd..fe17a95 100644 +index 07b9b42e01..fb09de989b 100644 --- a/ui/qt/iax2_analysis_dialog.cpp +++ b/ui/qt/iax2_analysis_dialog.cpp -@@ -37,6 +37,7 @@ +@@ -25,6 +25,7 @@ #include "ui/rtp_stream.h" #endif #include @@ -51,7 +51,7 @@ index ee4e5fd..fe17a95 100644 #include #include -@@ -271,10 +272,10 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) : +@@ -255,10 +256,10 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) : // We keep our temp files open for the lifetime of the dialog. The GTK+ // UI opens and closes at various points. @@ -65,7 +65,7 @@ index ee4e5fd..fe17a95 100644 rev_tempfile_->open(); diff --git a/ui/qt/utils/rtp_audio_file.cpp b/ui/qt/utils/rtp_audio_file.cpp -index 591a63b..203f5c5 100644 +index 591a63bbf3..203f5c5286 100644 --- a/ui/qt/utils/rtp_audio_file.cpp +++ b/ui/qt/utils/rtp_audio_file.cpp @@ -31,6 +31,7 @@ @@ -86,66 +86,67 @@ index 591a63b..203f5c5 100644 } else { sample_file_ = new QBuffer(this); diff --git a/wsutil/tempfile.c b/wsutil/tempfile.c -index 5082452..f751a7c 100644 +index f93f96d538..73964a1def 100644 --- a/wsutil/tempfile.c +++ b/wsutil/tempfile.c -@@ -12,10 +12,12 @@ - - #include +@@ -14,10 +14,12 @@ + #include "tempfile.h" + #include "file_util.h" +#include +#include /* for get_tmp_dir() */ - + /** * Create a tempfile with the given prefix (e.g. "wireshark"). The path - * is created using g_file_open_tmp. + * is created using get_tmp_dir. * + * @param tempdir [in] If not NULL, the directory in which to create the file. * @param namebuf [in,out] If not NULL, receives the full path of the temp file. - * Must be freed. -@@ -30,6 +31,9 @@ create_tempfile(gchar **namebuf, const char *pfx, const char *sfx, GError **err) +@@ -33,6 +33,9 @@ create_tempfile(const char *tempdir, gchar **namebuf, const char *pfx, const cha { int fd; gchar *safe_pfx = NULL; + gchar *tmp_file; + const char *tmp_dir; + int old_mask; - + if (pfx) { /* The characters in "delimiters" come from: -@@ -49,7 +53,15 @@ create_tempfile(gchar **namebuf, const char *pfx, const char *sfx, GError **err) - gchar* filetmpl = g_strdup_printf("%sXXXXXX%s", safe_pfx ? safe_pfx : "", sfx ? sfx : ""); - g_free(safe_pfx); - -- fd = g_file_open_tmp(filetmpl, namebuf, err); -+ tmp_dir = get_tmp_dir(); -+ tmp_file = g_strconcat(tmp_dir, "/", filetmpl, NULL); +@@ -54,7 +57,16 @@ create_tempfile(const char *tempdir, gchar **namebuf, const char *pfx, const cha + gchar* filetmpl = ws_strdup_printf("%sXXXXXX%s", safe_pfx ? safe_pfx : "", sfx ? sfx : ""); + g_free(safe_pfx); + +- fd = g_file_open_tmp(filetmpl, namebuf, err); ++ tmp_dir = get_tmp_dir(); ++ tmp_file = g_strconcat(tmp_dir, "/", filetmpl, NULL); + -+ if (namebuf) -+ *namebuf = tmp_file; ++ if (namebuf) ++ *namebuf = tmp_file; + -+ old_mask = ws_umask(0077); -+ fd = mkstemps(tmp_file, sfx ? (int) strlen(sfx) : 0); -+ ws_umask(old_mask); - - g_free(filetmpl); - return fd; ++ old_mask = ws_umask(0077); ++ fd = mkstemps(tmp_file, sfx ? (int) strlen(sfx) : 0); ++ ws_umask(old_mask); ++ + g_free(filetmpl); + } + else { diff --git a/wsutil/tempfile.h b/wsutil/tempfile.h -index 1dca2df..bb3160c 100644 +index 70031b5419..72011e265a 100644 --- a/wsutil/tempfile.h +++ b/wsutil/tempfile.h -@@ -45,7 +45,7 @@ WS_DLL_PUBLIC char *get_tempfile_path(const char *filename); +@@ -23,7 +23,7 @@ extern "C" { /** * Create a tempfile with the given prefix (e.g. "wireshark"). The path - * is created using g_file_open_tmp. + * is created using get_tmp_dir and mkstemp. * + * @param tempdir [in] If not NULL, the directory in which to create the file. * @param namebuf [in,out] If not NULL, receives the full path of the temp file. - * Must be freed. diff --git a/wsutil/wstmpdir.c b/wsutil/wstmpdir.c new file mode 100644 -index 0000000..d8b733b +index 0000000000..9128d354ce --- /dev/null +++ b/wsutil/wstmpdir.c @@ -0,0 +1,71 @@ @@ -222,7 +223,7 @@ index 0000000..d8b733b +} diff --git a/wsutil/wstmpdir.h b/wsutil/wstmpdir.h new file mode 100644 -index 0000000..07ac583 +index 0000000000..07ac5837ac --- /dev/null +++ b/wsutil/wstmpdir.h @@ -0,0 +1,39 @@ @@ -266,4 +267,5 @@ index 0000000..07ac583 + +#endif -- -2.13.0 +2.37.3 + diff --git a/wireshark-0007-cmakelists.patch b/wireshark-0007-cmakelists.patch index 0d75fc3..b794372 100644 --- a/wireshark-0007-cmakelists.patch +++ b/wireshark-0007-cmakelists.patch @@ -1,20 +1,20 @@ diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt -index 0367cd1..6382a2c 100644 +index a55086c..0149801 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt -@@ -69,6 +69,7 @@ set(WSUTIL_PUBLIC_HEADERS - ws_mempbrk_int.h - ws_pipe.h +@@ -80,6 +80,7 @@ set(WSUTIL_PUBLIC_HEADERS ws_roundup.h + ws_return.h + wsgcrypt.h + wstmpdir.h wsjson.h wslog.h xtea.h -@@ -118,6 +118,7 @@ set(WSUTIL_COMMON_FILES - ws_getopt.c +@@ -135,6 +136,7 @@ set(WSUTIL_COMMON_FILES ws_mempbrk.c ws_pipe.c -+ wstmpdir.c wsgcrypt.c ++ wstmpdir.c wsjson.c wslog.c + xtea.c diff --git a/wireshark.spec b/wireshark.spec index 3d37710..6ca9275 100644 --- a/wireshark.spec +++ b/wireshark.spec @@ -1,13 +1,11 @@ %undefine __cmake_in_source_build %global with_lua 1 %global with_maxminddb 1 -%global plugins_version 3.6 -# added temporarily due to errors in libqt5core -%define _lto_cflags %{nil} +%global plugins_version 4.0 Summary: Network traffic analyzer Name: wireshark -Version: 3.6.8 +Version: 4.0.0 Release: 1%{?dist} Epoch: 1 License: GPL+ @@ -27,8 +25,8 @@ Patch4: wireshark-0004-Restore-Fedora-specific-groups.patch # Fedora-specific Patch5: wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch # Fedora-specific -Patch6: wireshark-0006-Move-tmp-to-var-tmp.patch -Patch7: wireshark-0007-cmakelists.patch +#Patch6: wireshark-0006-Move-tmp-to-var-tmp.patch +#Patch7: wireshark-0007-cmakelists.patch #install tshark together with wireshark GUI Requires: %{name}-cli = %{epoch}:%{version}-%{release} @@ -58,15 +56,17 @@ BuildRequires: desktop-file-utils BuildRequires: xdg-utils BuildRequires: bison BuildRequires: flex -BuildRequires: pcre-devel BuildRequires: perl(Pod::Html) BuildRequires: perl(Pod::Man) BuildRequires: perl(open) +BuildRequires: pcre2-devel Buildrequires: libssh-devel -BuildRequires: qt5-linguist -BuildRequires: qt5-qtbase-devel -BuildRequires: qt5-qtmultimedia-devel -BuildRequires: qt5-qtsvg-devel +BuildRequires: qt6-qttools-devel +BuildRequires: qt6-linguist +BuildRequires: qt6-qtbase-devel +BuildRequires: qt6-qt5compat-devel +BuildRequires: qt6-qtmultimedia-devel +BuildRequires: qt6-qtsvg-devel BuildRequires: zlib-devel BuildRequires: asciidoctor %if %{with_maxminddb} && 0%{?fedora} @@ -83,7 +83,6 @@ BuildRequires: systemd-devel BuildRequires: libnghttp2-devel BuildRequires: systemd-rpm-macros -Obsoletes: wireshark-qt, wireshark-gtk %description Wireshark allows you to examine protocol data stored in files or as it is @@ -124,6 +123,7 @@ and plugins. -DBUILD_wireshark=ON \ %if %{with_lua} && 0%{?fedora} -DENABLE_LUA=ON \ + -DLUA_VERSION_NUM=5.1 \ %else -DENABLE_LUA=OFF \ %endif @@ -135,11 +135,11 @@ and plugins. -DBUILD_randpktdump=OFF \ -DBUILD_androiddump=ON \ -DENABLE_SMI=ON \ + -DUSE_qt6=ON \ -DENABLE_PLUGINS=ON \ -DENABLE_NETLINK=ON \ -DBUILD_dcerpcidl2wrs=OFF \ - -DBUILD_sdjournal=ON \ - %{nil} + -DBUILD_sdjournal=ON %cmake_build @@ -162,7 +162,6 @@ mkdir -p "${IDIR}/wsutil" mkdir -p %{buildroot}%{_udevrulesdir} install -m 644 %{_vpath_builddir}/config.h epan/register.h "${IDIR}/" install -m 644 cfile.h file.h "${IDIR}/" -install -m 644 ws_symbol_export.h "${IDIR}/" install -m 644 epan/*.h "${IDIR}/epan/" install -m 644 epan/crypt/*.h "${IDIR}/epan/crypt" install -m 644 epan/ftypes/*.h "${IDIR}/epan/ftypes" @@ -170,7 +169,6 @@ install -m 644 epan/dfilter/*.h "${IDIR}/epan/dfilter" install -m 644 epan/dissectors/*.h "${IDIR}/epan/dissectors" install -m 644 wiretap/*.h "${IDIR}/wiretap" install -m 644 wsutil/*.h "${IDIR}/wsutil" -install -m 644 ws_diag_control.h "${IDIR}/" install -m 644 %{SOURCE2} %{buildroot}%{_udevrulesdir} install -Dpm 644 %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf @@ -226,6 +224,7 @@ fi %dir %{_libdir}/wireshark/plugins %{_libdir}/wireshark/extcap/ciscodump %{_libdir}/wireshark/extcap/udpdump +%{_libdir}/wireshark/extcap/wifidump %{_libdir}/wireshark/extcap/sshdump %{_libdir}/wireshark/extcap/sdjournal %{_libdir}/wireshark/extcap/dpauxmon @@ -253,6 +252,7 @@ fi %{_mandir}/man1/reordercap.* %{_mandir}/man1/sshdump.* %{_mandir}/man1/udpdump.* +%{_mandir}/man1/wifidump.* %{_mandir}/man1/androiddump.* %{_mandir}/man1/captype.* %{_mandir}/man1/ciscodump.* @@ -274,6 +274,9 @@ fi %{_libdir}/pkgconfig/%{name}.pc %changelog +* Thu Oct 06 2022 Kenneth Topp - 1:4.0.0-1 +- New version 4.0.0 + * Thu Sep 29 2022 Michal Ruprich - 1:3.6.8-2 - New version 3.6.8 - Fix for CVE-2022-3190