Skip to content

Commit

Permalink
fetcher: Always open tmpfiles in repo location
Browse files Browse the repository at this point in the history
In an installation environment (like a live ISO) we may
not have significant space outside of the target installation
repository.

There's no reason not to always open a linkable tempfile.  In
the future we should fix the pull path to verify the checksum
and then just directly link in the object instead of copying.

Closes: ostreedev#2571
  • Loading branch information
cgwalters committed Jun 6, 2023
1 parent 8762062 commit f7f6f87
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/libostree/ostree-fetcher-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,8 @@ static inline gboolean
_ostree_fetcher_tmpf_from_flags (OstreeFetcherRequestFlags flags, int dfd, GLnxTmpfile *tmpf,
GError **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))
if (!glnx_open_tmpfile_linkable_at (dfd, ".", O_RDWR | O_CLOEXEC, tmpf, error))
return FALSE;

if (!glnx_fchmod (tmpf->fd, 0644, error))
return FALSE;
return TRUE;
Expand Down

0 comments on commit f7f6f87

Please sign in to comment.