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>
This commit is contained in:
parent
268883d1a7
commit
065a762579
|
@ -418,7 +418,7 @@ static int ssh_open_remote_connection(const char* hostname, const unsigned int p
|
||||||
|
|
||||||
if (g_strcmp0(fifo, "-")) {
|
if (g_strcmp0(fifo, "-")) {
|
||||||
/* Open or create the output file */
|
/* Open or create the output file */
|
||||||
fp = fopen(fifo, "w");
|
fp = fopen(fifo, "wb");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
g_warning("Error creating output file: %s", g_strerror(errno));
|
g_warning("Error creating output file: %s", g_strerror(errno));
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
@ -107,7 +107,7 @@ static int setup_dumpfile(const char* fifo, FILE** fp)
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
*fp = fopen(fifo, "w");
|
*fp = fopen(fifo, "wb");
|
||||||
if (!(*fp)) {
|
if (!(*fp)) {
|
||||||
g_warning("Error creating output file: %s", g_strerror(errno));
|
g_warning("Error creating output file: %s", g_strerror(errno));
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
@ -172,7 +172,7 @@ static int setup_dumpfile(const char* fifo, FILE** fp)
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
*fp = fopen(fifo, "w");
|
*fp = fopen(fifo, "wb");
|
||||||
if (!(*fp)) {
|
if (!(*fp)) {
|
||||||
g_warning("Error creating output file: %s", g_strerror(errno));
|
g_warning("Error creating output file: %s", g_strerror(errno));
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
Loading…
Reference in New Issue