aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-02-11 03:57:49 +0000
committerGuy Harris <guy@alum.mit.edu>2012-02-11 03:57:49 +0000
commit31204e84065c26fa17542f2e22ae112a3c61899c (patch)
tree2beda106dd1c64bdad5fd7b14dc6536a94f01f4c /tshark.c
parentc972b866b5be9e384321a82d460e1ff209b7b9b8 (diff)
It is a complete mistake to have *ANY* messages during packet capture
sent to the standard output if "-w" is specified because, when you capture, you can capture with the output directed to the standard output, and dumping some text crap to the standard output will corrupt your capture file. svn path=/trunk/; revision=40966
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/tshark.c b/tshark.c
index 296ab4a5ff..efe2936d73 100644
--- a/tshark.c
+++ b/tshark.c
@@ -756,16 +756,12 @@ print_current_user(void) {
cur_group = get_cur_groupname();
fprintf(stderr, "Running as user \"%s\" and group \"%s\".",
cur_user, cur_group);
- if (running_with_special_privs()) {
- fprintf(stderr, "Running as user \"%s\" and group \"%s\". This could be dangerous.\n",
- cur_user, cur_group);
- }
- else {
- fprintf(stdout, "Running as user \"%s\" and group \"%s\".",
- cur_user, cur_group);
- }
g_free(cur_user);
g_free(cur_group);
+ if (running_with_special_privs()) {
+ fprintf(stderr, " This could be dangerous.");
+ }
+ fprintf(stderr, "\n");
}
}
@@ -2114,7 +2110,7 @@ capture(void)
} else {
g_string_append_printf(str, "%u interfaces", global_capture_opts.ifaces->len);
}
- fprintf(stdout, "Capturing on %s\n", str->str);
+ fprintf(stderr, "Capturing on %s\n", str->str);
g_string_free(str, TRUE);
ret = sync_pipe_start(&global_capture_opts);
@@ -2373,7 +2369,7 @@ report_counts(void)
if (!print_packet_counts) {
/* Report the count only if we aren't printing a packet count
as packets arrive. */
- fprintf(stdout, "%u packet%s captured\n", packet_count,
+ fprintf(stderr, "%u packet%s captured\n", packet_count,
plurality(packet_count, "", "s"));
}
#ifdef SIGINFO