From bbfe253dac12eb73cd9c5cf7702a0192a7fac424 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 11 Oct 2019 13:52:50 +0200 Subject: [PATCH] flatpak run: Use /tmp instead of /var/tmp for small tmpfiles This writes temporary files needed for .xauth and seccomp to /tmp rather than /var/tmp. This is useful because /tmp is more likely to be tmpfs, and thus not run into diskspace issues. --- common/flatpak-run.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/flatpak-run.c b/common/flatpak-run.c index bdba6b91..03110565 100644 --- a/common/flatpak-run.c +++ b/common/flatpak-run.c @@ -203,7 +203,7 @@ flatpak_run_add_x11_args (FlatpakBwrap *bwrap, #ifdef ENABLE_XAUTH g_auto(GLnxTmpfile) xauth_tmpf = { 0, }; - if (glnx_open_anonymous_tmpfile (O_RDWR | O_CLOEXEC, &xauth_tmpf, NULL)) + if (glnx_open_anonymous_tmpfile_full (O_RDWR | O_CLOEXEC, "/tmp", &xauth_tmpf, NULL)) { FILE *output = fdopen (xauth_tmpf.fd, "wb"); if (output != NULL) @@ -2630,7 +2630,7 @@ setup_seccomp (FlatpakBwrap *bwrap, /* Blacklist the rest */ seccomp_rule_add_exact (seccomp, SCMP_ACT_ERRNO (EAFNOSUPPORT), SCMP_SYS (socket), 1, SCMP_A0 (SCMP_CMP_GE, last_allowed_family + 1)); - if (!glnx_open_anonymous_tmpfile (O_RDWR | O_CLOEXEC, &seccomp_tmpf, error)) + if (!glnx_open_anonymous_tmpfile_full (O_RDWR | O_CLOEXEC, "/tmp", &seccomp_tmpf, error)) return FALSE; if (seccomp_export_bpf (seccomp, seccomp_tmpf.fd) != 0)