diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-07-19 02:27:02 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-07-19 09:30:52 +0000 |
commit | 065a76257935e0699b6cf4aa2352d2f7de914a87 (patch) | |
tree | c3fbbf729617b2b8642349aef099a2cf197c3456 /extcap | |
parent | 268883d1a7f8b47e8e30a66388504e6fc8efb813 (diff) |
Extcap programs must write to the packet pipe in binary mode.
It doesn't matter on UN*X, but it definitely matters on Windows; we're
writing a pcap file, not a text file, so every byte we write should go
down the pipe as is.
Bug: 14989
Change-Id: I26c067b8ff5dba644a579846dd97b568a81c7053
Reviewed-on: https://code.wireshark.org/review/28764
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'extcap')
-rw-r--r-- | extcap/ciscodump.c | 2 | ||||
-rw-r--r-- | extcap/dpauxmon.c | 2 | ||||
-rw-r--r-- | extcap/udpdump.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/extcap/ciscodump.c b/extcap/ciscodump.c index 2f05996816..9f2eed5b8f 100644 --- a/extcap/ciscodump.c +++ b/extcap/ciscodump.c @@ -418,7 +418,7 @@ static int ssh_open_remote_connection(const char* hostname, const unsigned int p if (g_strcmp0(fifo, "-")) { /* Open or create the output file */ - fp = fopen(fifo, "w"); + fp = fopen(fifo, "wb"); if (!fp) { g_warning("Error creating output file: %s", g_strerror(errno)); return EXIT_FAILURE; diff --git a/extcap/dpauxmon.c b/extcap/dpauxmon.c index b31a216f4f..f16ec80d12 100644 --- a/extcap/dpauxmon.c +++ b/extcap/dpauxmon.c @@ -107,7 +107,7 @@ static int setup_dumpfile(const char* fifo, FILE** fp) return EXIT_SUCCESS; } - *fp = fopen(fifo, "w"); + *fp = fopen(fifo, "wb"); if (!(*fp)) { g_warning("Error creating output file: %s", g_strerror(errno)); return EXIT_FAILURE; diff --git a/extcap/udpdump.c b/extcap/udpdump.c index 7ed6cbfdfd..121b3c4816 100644 --- a/extcap/udpdump.c +++ b/extcap/udpdump.c @@ -172,7 +172,7 @@ static int setup_dumpfile(const char* fifo, FILE** fp) return EXIT_SUCCESS; } - *fp = fopen(fifo, "w"); + *fp = fopen(fifo, "wb"); if (!(*fp)) { g_warning("Error creating output file: %s", g_strerror(errno)); return EXIT_FAILURE; |