aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2022-12-10 17:49:59 -0800
committerGerald Combs <gerald@wireshark.org>2022-12-12 18:34:21 +0000
commitcb420c79117225fa5f896b07210cfe0ea74ce094 (patch)
treeecc145dbcf86717c4da19c1b786f6b7371fdfe0c /dumpcap.c
parent5aa1871ee0d0e87129d77328061aebace9983cde (diff)
Extcap: Create our fifo in a temporary directory.
Instead of creating a temp file, unlinking it, and creating a fifo with the same name, add create_tempdir() so that we can create a temporary directory and create a fifo inside that. This should avoid a race condition in Carbon Black Cloud antivirus, which if the timing is right, will stat the initial temporary *file*, miss the fact that it's been replaced with a *fifo*, and open and steal data^W^W read from it, leaving dumpcap to contend with the truncated remains. Adding the unexpected magic number to cap_pipe_open_live()'s error message helped to debug this. Leave it in since it's handy to have in that case. Ping #15587
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 5ac209015e..e09f27d59d 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -1850,7 +1850,7 @@ cap_pipe_open_live(char *pipename,
/* Not a pcapng file, and either not a pcap type we know about
or not a pcap file, either. */
snprintf(errmsg, (gulong)errmsgl,
- "Data written to the pipe is neither in a supported pcap format nor in pcapng format.");
+ "File type is neither a supported pcap nor pcapng format. (magic = 0x%08x)", magic);
snprintf(secondary_errmsg, (gulong)secondary_errmsgl, "%s",
not_our_bug);
goto error;