[wireshark] add missing patch

Jan Šafránek jsafrane at fedoraproject.org
Fri Nov 26 13:30:53 UTC 2010


commit 15575571aa69e399ab6f1cc54cbd3c14a0c20a69
Author: Jan Safranek <jsafrane at redhat.com>
Date:   Fri Nov 26 14:30:45 2010 +0100

    add missing patch

 wireshark-1.4.2-group-msg.patch |   60 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)
---
diff --git a/wireshark-1.4.2-group-msg.patch b/wireshark-1.4.2-group-msg.patch
new file mode 100644
index 0000000..8ad42df
--- /dev/null
+++ b/wireshark-1.4.2-group-msg.patch
@@ -0,0 +1,60 @@
+Customize 'permission denied' error.
+
+From: Jan Safranek <jsafrane at redhat.com>
+
+Add Fedora-specific message to error output when dumpcap cannot be started
+because of permissions.
+
+Signed-off-by: Jan Safranek <jsafrane at redhat.com>
+---
+
+ capture_sync.c |   14 ++++++++++----
+ 1 files changed, 10 insertions(+), 4 deletions(-)
+
+
+diff --git a/capture_sync.c b/capture_sync.c
+index 68b79f7..71de366 100644
+--- a/capture_sync.c
++++ b/capture_sync.c
+@@ -351,6 +351,7 @@ sync_pipe_start(capture_options *capture_opts) {
+     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
+@@ -596,8 +597,10 @@ sync_pipe_start(capture_options *capture_opts) {
+       dup2(sync_pipe[PIPE_WRITE], 2);
+       ws_close(sync_pipe[PIPE_READ]);
+       execv(argv[0], (gpointer)argv);
+-      g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
+-                argv[0], strerror(errno));
++      if (errno == EPERM || errno == EACCES)
++          securitymsg = "\nAre you memeber of 'wireshark' group? Try running 'usermod -a -G wireshark <username>' as root.";
++      g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s",
++                argv[0], strerror(errno), securitymsg);
+       sync_pipe_errmsg_to_parent(2, errmsg, "");
+ 
+       /* Exit with "_exit()", so that we don't close the connection
+@@ -687,6 +690,7 @@ sync_pipe_open_command(const 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
+@@ -811,8 +815,10 @@ sync_pipe_open_command(const char** argv, int *data_read_fd,
+         ws_close(sync_pipe[PIPE_READ]);
+         ws_close(sync_pipe[PIPE_WRITE]);
+         execv(argv[0], (gpointer)argv);
+-        g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
+-                   argv[0], strerror(errno));
++        if (errno == EPERM || errno == EACCES)
++            securitymsg = "\nAre you memeber of 'wireshark' group? Try running 'usermod -a -G wireshark <username>' as root.";
++        g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s",
++                   argv[0], strerror(errno), securitymsg);
+         sync_pipe_errmsg_to_parent(2, errmsg, "");
+ 
+         /* Exit with "_exit()", so that we don't close the connection


More information about the scm-commits mailing list