aboutsummaryrefslogtreecommitdiffstats
path: root/extcap.c
diff options
context:
space:
mode:
authorDavid Perry <boolean263@protonmail.com>2022-02-09 14:32:28 +0000
committerA Wireshark GitLab Utility <6629907-ws-gitlab-utility@users.noreply.gitlab.com>2022-02-09 14:32:28 +0000
commit1e0d117eb7ab1ce7f4ff8a4fd6dc2529634d7baa (patch)
treee7670b02e6c4d49e4f321864e730e0e48433b151 /extcap.c
parentf72787e86ff78790559fd5550e98865e225bfb68 (diff)
Specify directory for temporary captures
Diffstat (limited to 'extcap.c')
-rw-r--r--extcap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/extcap.c b/extcap.c
index 46f6aa392e..2e2a964958 100644
--- a/extcap.c
+++ b/extcap.c
@@ -1547,13 +1547,13 @@ static gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, HANDLE *ha
return TRUE;
}
#else
-static gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *pipe_prefix)
+static gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *temp_dir, const gchar *pipe_prefix)
{
gchar *temp_name = NULL;
int fd = 0;
gchar *pfx = g_strconcat(pipe_prefix, "_", ifname, NULL);
- if ((fd = create_tempfile(&temp_name, pfx, NULL, NULL)) < 0)
+ if ((fd = create_tempfile(temp_dir, &temp_name, pfx, NULL, NULL)) < 0)
{
g_free(pfx);
return FALSE;
@@ -1611,11 +1611,15 @@ extcap_init_interfaces(capture_options *capture_opts)
extcap_create_pipe(interface_opts->name, &interface_opts->extcap_control_in,
#ifdef _WIN32
&interface_opts->extcap_control_in_h,
+#else
+ capture_opts->temp_dir,
#endif
EXTCAP_CONTROL_IN_PREFIX);
extcap_create_pipe(interface_opts->name, &interface_opts->extcap_control_out,
#ifdef _WIN32
&interface_opts->extcap_control_out_h,
+#else
+ capture_opts->temp_dir,
#endif
EXTCAP_CONTROL_OUT_PREFIX);
}
@@ -1624,6 +1628,8 @@ extcap_init_interfaces(capture_options *capture_opts)
if (!extcap_create_pipe(interface_opts->name, &interface_opts->extcap_fifo,
#ifdef _WIN32
&interface_opts->extcap_pipe_h,
+#else
+ capture_opts->temp_dir,
#endif
EXTCAP_PIPE_PREFIX))
{