bstinson / rpms / rpm-ostree

Forked from rpms/rpm-ostree 5 years ago
Clone

Blame SOURCES/0001-libpriv-core-Always-call-rpmtsSetRootDir.patch

491aaa
From eae3a40f3b426525a805328c7552c292f510a780 Mon Sep 17 00:00:00 2001
491aaa
From: Jonathan Lebon <jonathan@jlebon.com>
491aaa
Date: Tue, 7 Aug 2018 15:59:09 -0400
491aaa
Subject: [PATCH] libpriv/core: Always call rpmtsSetRootDir()
491aaa
491aaa
Call `rpmtsSetRootDir()` even in the `JUSTDB` run. This brings us in
491aaa
line with libdnf and the rpm CLI itself, which both unconditionally call
491aaa
`rpmtsSetRootDir()` regardless of whether we're targeting the system
491aaa
root or a subdir.
491aaa
491aaa
This doesn't cause a `chroot()` to happen since librpm only does this
491aaa
if the target root dir is not `/`.
491aaa
491aaa
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1613517
491aaa
491aaa
Closes: #1492
491aaa
Approved by: cgwalters
491aaa
---
491aaa
 src/libpriv/rpmostree-core.c | 2 ++
491aaa
 1 file changed, 2 insertions(+)
491aaa
491aaa
diff --git a/src/libpriv/rpmostree-core.c b/src/libpriv/rpmostree-core.c
491aaa
index d38303fa..87e3d07b 100644
491aaa
--- a/src/libpriv/rpmostree-core.c
491aaa
+++ b/src/libpriv/rpmostree-core.c
491aaa
@@ -4009,6 +4009,8 @@ rpmostree_context_assemble (RpmOstreeContext      *self,
491aaa
   }
491aaa
 
491aaa
   g_auto(rpmts) rpmdb_ts = rpmtsCreate ();
491aaa
+  /* Always call rpmtsSetRootDir() here so rpmtsRootDir() isn't NULL -- see rhbz#1613517 */
491aaa
+  rpmtsSetRootDir (rpmdb_ts, "/");
491aaa
   rpmtsSetVSFlags (rpmdb_ts, _RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS);
491aaa
   /* https://bugzilla.redhat.com/show_bug.cgi?id=1607223
491aaa
    * Newer librpm defaults to doing a full payload checksum, which we can't
491aaa
-- 
491aaa
2.17.1
491aaa