From: Colin Walters Date: Mon, 26 Jun 2023 09:17:45 +0000 (-0400) Subject: Revert "fetcher: Always open tmpfiles in repo location" X-Git-Tag: archive/raspbian/2023.7-3+rpi1~1^2~9^2~1^2~8^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4e61e6f7d0d6aebd6abcdc455ec53164afe39e8d;p=ostree.git Revert "fetcher: Always open tmpfiles in repo location" This reverts commit f7f6f87c513c9f35bc24f35e909779c19cb49d3a. This seems to have broken flatpak, so we'll revert and then investigate. Closes: https://github.com/ostreedev/ostree/issues/2900 --- diff --git a/src/libostree/ostree-fetcher-util.h b/src/libostree/ostree-fetcher-util.h index 35f3e854..c3243801 100644 --- a/src/libostree/ostree-fetcher-util.h +++ b/src/libostree/ostree-fetcher-util.h @@ -35,8 +35,14 @@ static inline gboolean _ostree_fetcher_tmpf_from_flags (OstreeFetcherRequestFlags flags, int dfd, GLnxTmpfile *tmpf, GError **error) { - if (!glnx_open_tmpfile_linkable_at (dfd, ".", O_RDWR | O_CLOEXEC, tmpf, error)) + if ((flags & OSTREE_FETCHER_REQUEST_LINKABLE) > 0) + { + if (!glnx_open_tmpfile_linkable_at (dfd, ".", O_RDWR | O_CLOEXEC, tmpf, error)) + return FALSE; + } + else if (!glnx_open_anonymous_tmpfile (O_RDWR | O_CLOEXEC, tmpf, error)) return FALSE; + if (!glnx_fchmod (tmpf->fd, 0644, error)) return FALSE; return TRUE;