RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/wireshark#db8f5cd1f9f9f1ee5b85adb8721b89038de8480f
This commit is contained in:
Troy Dawson 2020-10-15 13:44:57 -07:00
parent b07b15256c
commit f2f6b190f3
10 changed files with 1639 additions and 0 deletions

3
.gitignore vendored
View File

@ -0,0 +1,3 @@
/wireshark-*.tar.bz2
/wireshark-*.tar.xz
/SIGNATURES-*.txt

View File

@ -0,0 +1 @@
SUBSYSTEM=="usbmon", GROUP="usbmon", MODE="640"

2
sources Normal file
View File

@ -0,0 +1,2 @@
SHA512 (wireshark-3.2.7.tar.xz) = c17913fe6c193ccc6b0dbf86932d625a1f3b670aef805296e5db2639118218e06d513910ad50ab3926204f94a0010425b0d498176f987516d64fdd6a52d2517b
SHA512 (SIGNATURES-3.2.7.txt) = c29a1f5772aff17efb7e4d3a7d88d717e788cc31915614b9d8b3b4588e40c33aeeb8183ae94eb7be51401f73557a0267a83f05b73097a793ebb8283f57c21644

View File

@ -0,0 +1,57 @@
From: Jan Safranek <jsafrane@redhat.com>
Date: Fri, 26 Nov 2010 14:30:45 +0300
Subject: [PATCH] Customize 'permission denied' error.
Add Fedora-specific message to error output when dumpcap cannot be started
because of permissions.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c
index 2f9d2cc..b18e47f 100644
--- a/capchild/capture_sync.c
+++ b/capchild/capture_sync.c
@@ -375,6 +375,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi
gchar *signal_pipe_name;
#else
char errmsg[1024+1];
+ const char *securitymsg = "";
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
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",
- 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);
+
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,
int i;
#else
char errmsg[1024+1];
+ const char *securitymsg = "";
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,
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",
- 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",
+ argv[0], g_strerror(errno), securitymsg);
sync_pipe_errmsg_to_parent(2, errmsg, "");
/* Exit with "_exit()", so that we don't close the connection

View File

@ -0,0 +1,18 @@
From: Peter Hatina <phatina@redhat.com>
Date: Wed, 4 Sep 2013 10:03:57 +0200
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
--- 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,
packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
{
guint32 u32Pointer;
- gchar szStr[1000];
+ gchar szStr[1000] = "";
guint32 u32MaxStr = sizeof(szStr);
gchar *call;

View File

@ -0,0 +1,15 @@
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Fri, 13 Sep 2013 14:36:55 +0400
Subject: [PATCH] Restore Fedora-specific groups
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
diff --git a/wireshark.desktop b/wireshark.desktop
index 334db48..669c6f1 100644
--- a/wireshark.desktop
+++ b/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:
# https://specifications.freedesktop.org/menu-spec/1.0/
-Categories=Network;Monitor;Qt;
+Categories=Application;Network;Monitor;Qt;

View File

@ -0,0 +1,20 @@
From: Kenneth Soerensen <knnthsrnsn@gmail.com>
Date: Wed, 29 Jan 2014 16:04:12 +0400
Subject: [PATCH] Fix paths in a wireshark.desktop file
diff --git a/wireshark.desktop b/wireshark.desktop
index 669c6f1..f7df1f3 100644
--- a/wireshark.desktop
+++ b/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]=Аналізатор мережевого трафіку
Icon=wireshark
-TryExec=wireshark
-Exec=wireshark %f
+TryExec=/usr/bin/wireshark
+Exec=/usr/bin/wireshark %f
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:

View File

@ -0,0 +1,287 @@
From cb54210f7f02b07768cfbf49ae266d487f580e1b Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 29 Jun 2017 15:32:58 +0200
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(-)
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
--- a/ui/qt/about_dialog.cpp
+++ b/ui/qt/about_dialog.cpp
@@ -26,6 +26,7 @@
#include "wireshark_application.h"
#include <wsutil/filesystem.h>
+#include <wsutil/wstmpdir.h> /* for get_tmp_dir() */
#include <QDesktopServices>
#include <QUrl>
@@ -206,7 +206,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"));
/* 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
--- a/ui/qt/iax2_analysis_dialog.cpp
+++ b/ui/qt/iax2_analysis_dialog.cpp
@@ -37,6 +37,7 @@
#include "ui/rtp_stream.h"
#endif
#include <wsutil/utf8_entities.h>
+#include <wsutil/wstmpdir.h> /* for get_tmp_dir() */
#include <wsutil/g711.h>
#include <wsutil/pint.h>
@@ -271,10 +272,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.
- QString tempname = QString("%1/wireshark_iax2_f").arg(QDir::tempPath());
+ QString tempname = QString("%1/wireshark_iax2_f").arg(get_tmp_dir());
fwd_tempfile_ = new QTemporaryFile(tempname, this);
fwd_tempfile_->open();
- tempname = QString("%1/wireshark_iax2_r").arg(QDir::tempPath());
+ tempname = QString("%1/wireshark_iax2_r").arg(get_tmp_dir());
rev_tempfile_ = new QTemporaryFile(tempname, this);
rev_tempfile_->open();
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp
index 5d82e46..8008984 100644
--- a/ui/qt/rtp_analysis_dialog.cpp
+++ b/ui/qt/rtp_analysis_dialog.cpp
@@ -37,6 +37,7 @@
#include <wsutil/g711.h>
#include <wsutil/pint.h>
+#include <wsutil/wstmpdir.h> /* for get_tmp_dir() */
#include <QMessageBox>
#include <QPushButton>
@@ -331,10 +332,10 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf, struct _r
// We keep our temp files open for the lifetime of the dialog. The GTK+
// UI opens and closes at various points.
- QString tempname = QString("%1/wireshark_rtp_f").arg(QDir::tempPath());
+ QString tempname = QString("%1/wireshark_rtp_f").arg(get_tmp_dir());
fwd_tempfile_ = new QTemporaryFile(tempname, this);
fwd_tempfile_->open();
- tempname = QString("%1/wireshark_rtp_r").arg(QDir::tempPath());
+ tempname = QString("%1/wireshark_rtp_r").arg(get_tmp_dir());
rev_tempfile_ = new QTemporaryFile(tempname, this);
rev_tempfile_->open();
diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp
index fde66c8..b9531d2 100644
--- a/ui/qt/rtp_audio_stream.cpp
+++ b/ui/qt/rtp_audio_stream.cpp
@@ -37,6 +37,7 @@
#include <ui/rtp_stream.h>
#include <wsutil/nstime.h>
+#include <wsutil/wstmpdir.h> /* for get_tmp_dir() */
#include <QAudioFormat>
#include <QAudioOutput>
@@ -76,7 +77,7 @@ RtpAudioStream::RtpAudioStream(QObject *parent, _rtp_stream_info *rtp_stream) :
visual_sample_rate_, SPEEX_RESAMPLER_QUALITY_MIN, NULL);
speex_resampler_skip_zeros(visual_resampler_);
- QString tempname = QString("%1/wireshark_rtp_stream").arg(QDir::tempPath());
+ QString tempname = QString("%1/wireshark_rtp_stream").arg(get_tmp_dir());
tempfile_ = new QTemporaryFile(tempname, this);
tempfile_->open();
diff --git a/wsutil/tempfile.c b/wsutil/tempfile.c
index 8e1f8dc..dcf2f78 100644
--- a/wsutil/tempfile.c
+++ b/wsutil/tempfile.c
@@ -36,6 +36,7 @@
#include "tempfile.h"
#include <wsutil/file_util.h>
+#include <wsutil/wstmpdir.h> /* for get_tmp_dir() */
#ifndef __set_errno
#define __set_errno(x) errno=(x)
@@ -83,13 +83,14 @@ mkstemps(char *path_template, int suffixlen)
*/
char *get_tempfile_path(const char *filename)
{
- return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), filename);
+ return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_tmp_dir(), filename);
}
#define MAX_TEMPFILES 3
/**
- * Create a tempfile with the given prefix (e.g. "wireshark").
+ * Create a tempfile with the given prefix (e.g. "wireshark"). The path
+ * is created using get_tmp_dir and mkdtemp
*
* @param namebuf If not NULL, receives the full path of the temp file.
* Should NOT be freed.
@@ -199,7 +200,7 @@ create_tempfile(char **namebuf, const char *pfx, const char *sfx)
tf[idx].path = (char *)g_malloc(tf[idx].len);
}
- tmp_dir = g_get_tmp_dir();
+ tmp_dir = get_tmp_dir();
#ifdef _WIN32
_tzset();
diff --git a/wsutil/tempfile.h b/wsutil/tempfile.h
index 1dca2df..bb3160c 100644
--- a/wsutil/tempfile.h
+++ b/wsutil/tempfile.h
@@ -45,7 +45,7 @@ WS_DLL_PUBLIC char *get_tempfile_path(const char *filename);
/**
* Create a tempfile with the given prefix (e.g. "wireshark"). The path
- * is created using g_get_tmp_dir and mkstemp.
+ * is created using get_tmp_dir and mkstemp.
*
* @param namebuf [in,out] If not NULL, receives the full path of the temp file.
* Must NOT be freed.
diff --git a/wsutil/wstmpdir.c b/wsutil/wstmpdir.c
new file mode 100644
index 0000000..d8b733b
--- /dev/null
+++ b/wsutil/wstmpdir.c
@@ -0,0 +1,70 @@
+/* wstmpdir.c
+ *
+ * Copyright (C) 2013 Red Hat, Inc. All right reserved.
+ *
+ * Temporary directory routine
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Author: Peter Hatina <phatina@redhat.com>
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include "wstmpdir.h"
+
+/**
+ * Gets the directory to use for temporary files.
+ *
+ * Inspired by glib-2.0. If no TMP, TEMP or TMPDIR is set,
+ * /var/tmp is returned (Fedora specific).
+ *
+ * Returns: the directory to use for temporary files.
+ */
+const char *get_tmp_dir(void)
+{
+ static gchar *tmp_dir;
+
+ if (g_once_init_enter(&tmp_dir)) {
+ gchar *tmp;
+
+ tmp = g_strdup(g_getenv("TEMP"));
+ if (tmp == NULL || *tmp == '\0') {
+ g_free(tmp);
+ tmp = g_strdup(g_getenv("TMPDIR"));
+ }
+
+#ifdef P_tmpdir
+ if (tmp == NULL || *tmp == '\0') {
+ gsize k;
+ g_free(tmp);
+ tmp = g_strdup(P_tmpdir);
+ k = strlen(tmp);
+ if (k > 1 && G_IS_DIR_SEPARATOR(tmp[k - 1]))
+ tmp[k - 1] = '\0';
+ }
+#endif /* P_tmpdir */
+
+ if (tmp == NULL || *tmp == '\0') {
+ g_free(tmp);
+ tmp = g_strdup("/var/tmp");
+ }
+
+ g_once_init_leave(&tmp_dir, tmp);
+ }
+
+ return tmp_dir;
+}
diff --git a/wsutil/wstmpdir.h b/wsutil/wstmpdir.h
new file mode 100644
index 0000000..07ac583
--- /dev/null
+++ b/wsutil/wstmpdir.h
@@ -0,0 +1,39 @@
+/* wstmpdir.c
+ *
+ * Copyright (C) 2013 Red Hat, Inc. All right reserved.
+ *
+ * Temporary directory routine
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Author: Peter Hatina <phatina@redhat.com>
+ */
+
+#ifndef __WS_TMP_DIR_H__
+#define __WS_TMP_DIR_H__
+
+#include "ws_symbol_export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+WS_DLL_PUBLIC const char *get_tmp_dir(void);
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif
--
2.13.0

View File

@ -0,0 +1,20 @@
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt
index 0367cd1..6382a2c 100644
--- a/wsutil/CMakeLists.txt
+++ b/wsutil/CMakeLists.txt
@@ -69,6 +69,7 @@ set(WSUTIL_PUBLIC_HEADERS
ws_mempbrk_int.h
ws_pipe.h
ws_printf.h
+ wstmpdir.h
wsjson.h
xtea.h
)
@@ -118,6 +118,7 @@ set(WSUTIL_COMMON_FILES
unicode-utils.c
ws_mempbrk.c
ws_pipe.c
+ wstmpdir.c
wsgcrypt.c
wsjson.c
xtea.c

1216
wireshark.spec Normal file

File diff suppressed because it is too large Load Diff