2013-09-10 10:16:03 +00:00
|
|
|
From: Jan Safranek <jsafrane@redhat.com>
|
|
|
|
Date: Fri, 26 Nov 2010 14:30:45 +0300
|
2013-11-13 11:53:53 +00:00
|
|
|
Subject: [PATCH] Customize 'permission denied' error.
|
2010-11-26 13:30:45 +00:00
|
|
|
|
|
|
|
Add Fedora-specific message to error output when dumpcap cannot be started
|
|
|
|
because of permissions.
|
|
|
|
|
2013-09-10 10:16:03 +00:00
|
|
|
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
|
|
|
|
2021-11-25 11:06:21 +00:00
|
|
|
diff --git a/capture/capture_sync.c b/capture/capture_sync.c
|
2022-10-06 04:30:26 +00:00
|
|
|
index 47a30a70c4..84d19568b0 100644
|
2021-11-25 11:06:21 +00:00
|
|
|
--- a/capture/capture_sync.c
|
|
|
|
+++ b/capture/capture_sync.c
|
2022-10-06 04:30:26 +00:00
|
|
|
@@ -336,6 +336,7 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments,
|
2010-11-26 13:30:45 +00:00
|
|
|
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
|
2022-10-06 04:30:26 +00:00
|
|
|
@@ -741,8 +742,10 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments,
|
2012-06-25 13:46:28 +00:00
|
|
|
dup2(sync_pipe[PIPE_WRITE], 2);
|
|
|
|
ws_close(sync_pipe[PIPE_READ]);
|
2013-06-17 13:19:18 +00:00
|
|
|
execv(argv[0], argv);
|
2022-10-06 04:30:26 +00:00
|
|
|
- snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
|
2012-06-25 13:46:28 +00:00
|
|
|
- argv[0], g_strerror(errno));
|
|
|
|
+ if (errno == EPERM || errno == EACCES)
|
2022-10-06 04:30:26 +00:00
|
|
|
+ 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);
|
2012-06-25 13:46:28 +00:00
|
|
|
sync_pipe_errmsg_to_parent(2, errmsg, "");
|
2010-11-26 13:30:45 +00:00
|
|
|
|
2012-06-25 13:46:28 +00:00
|
|
|
/* Exit with "_exit()", so that we don't close the connection
|
2022-10-06 04:30:26 +00:00
|
|
|
@@ -846,6 +849,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
|
New version 2.6.0
Fix for CVE-2018-9256, CVE-2018-9257, CVE-2018-9258, CVE-2018-9259, CVE-2018-9260, CVE-2018-9261, CVE-2018-9262, CVE-2018-9263, CVE-2018-9264, CVE-2018-9265, CVE-2018-9266, CVE-2018-9267, CVE-2018-9268, CVE-2018-9269, CVE-2018-9270, CVE-2018-9271, CVE-2018-9272, CVE-2018-9273, CVE-2018-9274
Switch from autotools to cmake
Removed python2-devel(#1560284) and libssh2-devel from dependencies
Removed python scripts
2018-05-02 11:34:24 +00:00
|
|
|
int i;
|
2010-11-26 13:30:45 +00:00
|
|
|
#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
|
2022-10-06 04:30:26 +00:00
|
|
|
@@ -994,8 +998,10 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
|
2010-11-26 13:30:45 +00:00
|
|
|
ws_close(sync_pipe[PIPE_READ]);
|
|
|
|
ws_close(sync_pipe[PIPE_WRITE]);
|
2013-06-17 13:19:18 +00:00
|
|
|
execv(argv[0], argv);
|
2022-10-06 04:30:26 +00:00
|
|
|
- snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
|
2011-07-21 09:20:56 +00:00
|
|
|
- argv[0], g_strerror(errno));
|
2022-10-06 04:30:26 +00:00
|
|
|
+ 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",
|
2013-09-10 10:16:03 +00:00
|
|
|
+ argv[0], g_strerror(errno), securitymsg);
|
2010-11-26 13:30:45 +00:00
|
|
|
sync_pipe_errmsg_to_parent(2, errmsg, "");
|
|
|
|
|
|
|
|
/* Exit with "_exit()", so that we don't close the connection
|