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

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