aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorsake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-08-28 09:44:18 +0000
committersake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-08-28 09:44:18 +0000
commit9db18c8e309626b90fd64c3ed57cf739c93be8d7 (patch)
treec953245f7455ba7a1659a46d3113b4376ceeb177 /dumpcap.c
parent9cc26dd342d2ef99d48001f6c333c891e6bb844a (diff)
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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33977 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'dumpcap.c')
-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;