capture_opts->default_options.cfilter = g_strdup(optarg_str_p);
}
break;
+ case 'g': /* enable group read access on the capture file(s) */
+ capture_opts->group_read_access = TRUE;
+ break;
case 'H': /* Hide capture info dialog box */
capture_opts->show_info = FALSE;
break;
capture_opts->save_file = g_strdup(optarg_str_p);
status = capture_opts_output_to_pipe(capture_opts->save_file, &capture_opts->output_to_pipe);
return status;
- case 'g': /* enable group read access on the capture file(s) */
- capture_opts->group_read_access = TRUE;
- break;
case 'y': /* Set the pcap data link type */
if (capture_opts->ifaces->len > 0) {
interface_options interface_opts;
}
-void capture_opts_trim_snaplen(capture_options *capture_opts, int snaplen_min)
+void
+capture_opts_trim_snaplen(capture_options *capture_opts, int snaplen_min)
{
guint i;
interface_options interface_opts;
}
-void capture_opts_trim_ring_num_files(capture_options *capture_opts)
+void
+capture_opts_trim_ring_num_files(capture_options *capture_opts)
{
/* Check the value range of the ring_num_files parameter */
if (capture_opts->ring_num_files > RINGBUFFER_MAX_NUM_FILES) {
#endif
/* copied from filesystem.c */
-static int capture_opts_test_for_fifo(const char *path)
+static int
+capture_opts_test_for_fifo(const char *path)
{
ws_statb64 statb;
return 0;
}
-static gboolean capture_opts_output_to_pipe(const char *save_file, gboolean *is_pipe)
+static gboolean
+capture_opts_output_to_pipe(const char *save_file, gboolean *is_pipe)
{
int err;
argv = sync_pipe_add_arg(argv, &argc, sautostop_duration);
}
+ if (capture_opts->group_read_access) {
+ argv = sync_pipe_add_arg(argv, &argc, "-g");
+ }
+
for (j = 0; j < capture_opts->ifaces->len; j++) {
interface_opts = g_array_index(capture_opts->ifaces, interface_options, j);
case 'b': /* Ringbuffer option */
case 'c': /* Capture x packets */
case 'f': /* capture filter */
- case 'g': /* enable group read accesson file(s) */
+ case 'g': /* enable group read access on file(s) */
case 'i': /* Use interface x */
case 'n': /* Use pcapng format */
case 'p': /* Don't capture in promiscuous mode */
#define OPTSTRING_I ""
#endif
-#define OPTSTRING "2a:" OPTSTRING_A "b:" OPTSTRING_B "c:C:d:De:E:f:F:G:hH:i:" OPTSTRING_I "K:lLnN:o:O:pPqr:R:s:S:t:T:u:vVw:W:xX:y:z:"
+#define OPTSTRING "2a:" OPTSTRING_A "b:" OPTSTRING_B "c:C:d:De:E:f:F:gG:hH:i:" OPTSTRING_I "K:lLnN:o:O:pPqr:R:s:S:t:T:u:vVw:W:xX:y:z:"
static const char optstring[] = OPTSTRING;
case 'b': /* Ringbuffer option */
case 'c': /* Capture x packets */
case 'f': /* capture filter */
- case 'g': /* enable group read accesson file(s) */
+ case 'g': /* enable group read access on file(s) */
case 'i': /* Use interface x */
case 'p': /* Don't capture in promiscuous mode */
#ifdef HAVE_PCAP_REMOTE