summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2010-08-28 09:44:18 +0000
committerSake Blok <sake@euronet.nl>2010-08-28 09:44:18 +0000
commit42a0f16cef0e3009168d8c2ffa6987ffcf8ecca4 (patch)
treec953245f7455ba7a1659a46d3113b4376ceeb177
parentfe34e9a3fbae90c4ea81a16db6904386697d6f78 (diff)
downloadwireshark-42a0f16cef0e3009168d8c2ffa6987ffcf8ecca4.tar.gz
We change the owner and group of the first file, so we also want to change owner and group of the rest of the files in the ringbuffer.
svn path=/trunk/; revision=33977
-rw-r--r--dumpcap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 30454d308a..15c55c188c 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -2749,6 +2749,9 @@ do_file_switch_or_stop(capture_options *capture_opts,
if (ringbuf_switch_file(&global_ld.pdh, &capture_opts->save_file,
&global_ld.save_file_fd, &global_ld.err)) {
gboolean successful;
+#ifndef _WIN32
+ int ret;
+#endif
/* File switch succeeded: reset the conditions */
global_ld.bytes_written = 0;
@@ -2777,6 +2780,10 @@ do_file_switch_or_stop(capture_options *capture_opts,
report_packet_count(global_ld.inpkts_to_sync_pipe);
global_ld.inpkts_to_sync_pipe = 0;
report_new_capture_file(capture_opts->save_file);
+
+#ifndef _WIN32
+ ret = fchown(global_ld.save_file_fd, capture_opts->owner, capture_opts->group);
+#endif
} else {
/* File switch failed: stop here */
global_ld.go = FALSE;