b1047b
Customize 'permission denied' error.
b1047b
b1047b
Add Fedora-specific message to error output when dumpcap cannot be started
b1047b
because of permissions.
b1047b
b1047b
diff --git a/capture_sync.c b/capture_sync.c
b1047b
index 8c49ed2..65e242d 100644
b1047b
--- a/capture_sync.c
b1047b
+++ b/capture_sync.c
b1047b
@@ -369,6 +369,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session)
b1047b
     gchar *signal_pipe_name;
b1047b
 #else
b1047b
     char errmsg[1024+1];
b1047b
+    const char *securitymsg = "";
b1047b
     int sync_pipe[2];                       /* pipe used to send messages from child to parent */
b1047b
     enum PIPES { PIPE_READ, PIPE_WRITE };   /* Constants 0 and 1 for PIPE_READ and PIPE_WRITE */
b1047b
 #endif
b1047b
@@ -639,8 +640,10 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session)
b1047b
         dup2(sync_pipe[PIPE_WRITE], 2);
b1047b
         ws_close(sync_pipe[PIPE_READ]);
b1047b
         execv(argv[0], argv);
b1047b
-        g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
b1047b
-                   argv[0], g_strerror(errno));
b1047b
+        if (errno == EPERM || errno == EACCES)
b1047b
+            securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root.";
b1047b
+        g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s",
b1047b
+            argv[0], g_strerror(errno), securitymsg);
b1047b
         sync_pipe_errmsg_to_parent(2, errmsg, "");
b1047b
 
b1047b
         /* Exit with "_exit()", so that we don't close the connection
b1047b
@@ -732,6 +735,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd,
b1047b
     PROCESS_INFORMATION pi;
b1047b
 #else
b1047b
     char errmsg[1024+1];
b1047b
+    const char *securitymsg = "";
b1047b
     int sync_pipe[2];                       /* pipe used to send messages from child to parent */
b1047b
     int data_pipe[2];                       /* pipe used to send data from child to parent */
b1047b
 #endif
b1047b
@@ -866,8 +870,10 @@ sync_pipe_open_command(char** argv, int *data_read_fd,
b1047b
         ws_close(sync_pipe[PIPE_READ]);
b1047b
         ws_close(sync_pipe[PIPE_WRITE]);
b1047b
         execv(argv[0], argv);
b1047b
-        g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
b1047b
-                   argv[0], g_strerror(errno));
b1047b
+        if (errno == EPERM || errno == EACCES)
b1047b
+            securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root.";
b1047b
+        g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s",
b1047b
+            argv[0], g_strerror(errno), securitymsg);
b1047b
         sync_pipe_errmsg_to_parent(2, errmsg, "");
b1047b
 
b1047b
         /* Exit with "_exit()", so that we don't close the connection