From c467a48c6075d14cee70a37c6206ac032bb9771d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 09:04:03 +0000 Subject: import rpm-ostree-client-2018.5-2.atomic.el7 --- diff --git a/SOURCES/0001-core-Use-new-rpmtsSetVfyLevel-API-for-writing-rpmdb.patch b/SOURCES/0001-core-Use-new-rpmtsSetVfyLevel-API-for-writing-rpmdb.patch new file mode 100644 index 0000000..3bb8a7a --- /dev/null +++ b/SOURCES/0001-core-Use-new-rpmtsSetVfyLevel-API-for-writing-rpmdb.patch @@ -0,0 +1,57 @@ +From da27b94b2903ce10a3b0063da62fea8f90a93675 Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Mon, 23 Jul 2018 16:37:43 +0000 +Subject: [PATCH] core: Use new `rpmtsSetVfyLevel()` API for writing rpmdb + +Newer librpm defaults to doing a full payload checksum, which we can't +do at this point (writing the db) because we imported the RPMs into +ostree commits, saving just the header in metadata - we don't have the +exact original content to provide again. + +Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1607223 + +Closes: #1469 +Approved by: jlebon +--- + configure.ac | 4 ++++ + src/libpriv/rpmostree-core.c | 9 +++++++++ + 2 files changed, 13 insertions(+) + +diff --git a/configure.ac b/configure.ac +index e1e771ac..f1aa0751 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -110,6 +110,10 @@ AS_IF([pkg-config --atleast-version=4.13.0.1 rpm], [ + AC_DEFINE([BUILDOPT_HAVE_RPM_FILETRIGGERS], 1, [Set to 1 if we have file triggers]) + AC_DEFINE([BUILDOPT_HAVE_RPMFILES], 1, [Set to 1 if we have rpmfiles API]) + ], [have_modern_rpm=false]) ++dnl See usage ++AS_IF([pkg-config --atleast-version=4.14.2-rc1 rpm], [ ++ AC_DEFINE([BUILDOPT_HAVE_NEW_RPM_VERIFY], 1, [Set to 1 if we have rpmtsSetVfyLevel]) ++]) + + AC_PATH_PROG([XSLTPROC], [xsltproc]) + +diff --git a/src/libpriv/rpmostree-core.c b/src/libpriv/rpmostree-core.c +index 68ac8871..d38303fa 100644 +--- a/src/libpriv/rpmostree-core.c ++++ b/src/libpriv/rpmostree-core.c +@@ -4010,6 +4010,15 @@ rpmostree_context_assemble (RpmOstreeContext *self, + + g_auto(rpmts) rpmdb_ts = rpmtsCreate (); + rpmtsSetVSFlags (rpmdb_ts, _RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS); ++ /* https://bugzilla.redhat.com/show_bug.cgi?id=1607223 ++ * Newer librpm defaults to doing a full payload checksum, which we can't ++ * do at this point because we imported the RPMs into ostree commits, saving ++ * just the header in metadata - we don't have the exact original content to ++ * provide again. ++ */ ++#ifdef BUILDOPT_HAVE_NEW_RPM_VERIFY ++ rpmtsSetVfyLevel (rpmdb_ts, 0); ++#endif + rpmtsSetFlags (rpmdb_ts, RPMTRANS_FLAG_JUSTDB); + + tdata.ctx = self; +-- +2.17.1 + diff --git a/SOURCES/0001-libpriv-core-Always-call-rpmtsSetRootDir.patch b/SOURCES/0001-libpriv-core-Always-call-rpmtsSetRootDir.patch new file mode 100644 index 0000000..fea5f6f --- /dev/null +++ b/SOURCES/0001-libpriv-core-Always-call-rpmtsSetRootDir.patch @@ -0,0 +1,37 @@ +From eae3a40f3b426525a805328c7552c292f510a780 Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +Date: Tue, 7 Aug 2018 15:59:09 -0400 +Subject: [PATCH] libpriv/core: Always call rpmtsSetRootDir() + +Call `rpmtsSetRootDir()` even in the `JUSTDB` run. This brings us in +line with libdnf and the rpm CLI itself, which both unconditionally call +`rpmtsSetRootDir()` regardless of whether we're targeting the system +root or a subdir. + +This doesn't cause a `chroot()` to happen since librpm only does this +if the target root dir is not `/`. + +Related: https://bugzilla.redhat.com/show_bug.cgi?id=1613517 + +Closes: #1492 +Approved by: cgwalters +--- + src/libpriv/rpmostree-core.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/libpriv/rpmostree-core.c b/src/libpriv/rpmostree-core.c +index d38303fa..87e3d07b 100644 +--- a/src/libpriv/rpmostree-core.c ++++ b/src/libpriv/rpmostree-core.c +@@ -4009,6 +4009,8 @@ rpmostree_context_assemble (RpmOstreeContext *self, + } + + g_auto(rpmts) rpmdb_ts = rpmtsCreate (); ++ /* Always call rpmtsSetRootDir() here so rpmtsRootDir() isn't NULL -- see rhbz#1613517 */ ++ rpmtsSetRootDir (rpmdb_ts, "/"); + rpmtsSetVSFlags (rpmdb_ts, _RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS); + /* https://bugzilla.redhat.com/show_bug.cgi?id=1607223 + * Newer librpm defaults to doing a full payload checksum, which we can't +-- +2.17.1 + diff --git a/SPECS/rpm-ostree-client.spec b/SPECS/rpm-ostree-client.spec index 2e37c65..acb49a0 100644 --- a/SPECS/rpm-ostree-client.spec +++ b/SPECS/rpm-ostree-client.spec @@ -2,13 +2,15 @@ Summary: Client side upgrade program Name: rpm-ostree-client Version: 2018.5 -Release: 1.atomic%{?dist} +Release: 2.atomic%{?dist} #VCS: https://github.com/projectatomic/rpm-ostree # This tarball is generated via "make -f Makefile.dist-packaging dist-snapshot-without-compose-tooling" Source0: rpm-ostree-client-%{version}.tar.xz License: LGPLv2+ URL: https://github.com/projectatomic/rpm-ostree Source1: https://github.com/projectatomic/bubblewrap/releases/download/v%{bubblewrap_version}/bubblewrap-%{bubblewrap_version}.tar.xz +Patch0: 0001-core-Use-new-rpmtsSetVfyLevel-API-for-writing-rpmdb.patch +Patch1: 0001-libpriv-core-Always-call-rpmtsSetRootDir.patch Requires: ostree-fuse @@ -128,6 +130,9 @@ python autofiles.py > files \ %doc COPYING README.md %changelog +* Tue Aug 21 2018 Jonathan Lebon - 2018.5-2.atomic +- Backport patch to always call rpmtsSetRootDir (#1613517) + * Tue May 29 2018 Jonathan Lebon - 2018.5-1.atomic - New upstream release - Resolves: #1566232