OCI: Switch to pax format for tar archives

For reasons unknown, libarchive appears to generate broken gnutar format
tar archives when the archive contains files that are larger than 2 GB.
This commit switches to the pax format to work this around.

This should be a better default as it also removes 256 char filename
length limitation and matches what other libraries are doing, e.g.
Python 3.8 switched to the pax format by default as well.

See https://pagure.io/fedora-infrastructure/issue/9840
This commit is contained in:
Kalev Lember 2021-04-05 17:09:46 +02:00
parent d36f538490
commit fb7919120d
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From adbd286cef9a4c4bed76eb95337d5d6f5e42dd45 Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Mon, 5 Apr 2021 10:40:26 +0200
Subject: [PATCH] OCI: Switch to pax format for tar archives
For reasons unknown, libarchive appears to generate broken gnutar format
tar archives when the archive contains files that are larger than 2 GB.
This commit switches to the pax format to work this around.
This should be a better default as it also removes 256 char filename
length limitation and matches what other libraries are doing, e.g.
Python 3.8 switched to the pax format by default as well.
See https://pagure.io/fedora-infrastructure/issue/9840
---
common/flatpak-oci-registry.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/flatpak-oci-registry.c b/common/flatpak-oci-registry.c
index 6aa68c27..2a7f3ba1 100644
--- a/common/flatpak-oci-registry.c
+++ b/common/flatpak-oci-registry.c
@@ -1476,7 +1476,7 @@ flatpak_oci_registry_write_layer (FlatpakOciRegistry *self,
}
a = archive_write_new ();
- if (archive_write_set_format_gnutar (a) != ARCHIVE_OK ||
+ if (archive_write_set_format_pax (a) != ARCHIVE_OK ||
archive_write_add_filter_none (a) != ARCHIVE_OK)
{
propagate_libarchive_error (error, a);
--
2.30.2

View File

@ -3,7 +3,7 @@
Name: flatpak
Version: 1.10.2
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Application deployment framework for desktop apps
License: LGPLv2+
@ -12,6 +12,10 @@ Source0: https://github.com/flatpak/flatpak/releases/download/%{version}/
# Add Fedora flatpak repositories
Source1: flatpak-add-fedora-repos.service
# https://github.com/flatpak/flatpak/pull/4210
# https://pagure.io/fedora-infrastructure/issue/9840
Patch0: 0001-OCI-Switch-to-pax-format-for-tar-archives.patch
BuildRequires: pkgconfig(appstream-glib)
BuildRequires: pkgconfig(dconf)
BuildRequires: pkgconfig(fuse)
@ -260,6 +264,9 @@ fi
%changelog
* Mon Apr 05 2021 Kalev Lember <klember@redhat.com> - 1.10.2-2
- OCI: Switch to pax format for tar archives
* Wed Mar 10 2021 Kalev Lember <klember@redhat.com> - 1.10.2-1
- Update to 1.10.2