Blame SOURCES/0013-daemon-rpm-c.c-Disable-signature-checking-in-librpm.patch

a7e38b
From 46c0694ce0b9a2fe357403c998d30ec807e07015 Mon Sep 17 00:00:00 2001
a7e38b
From: "Richard W.M. Jones" <rjones@redhat.com>
a7e38b
Date: Tue, 15 Mar 2022 10:22:49 +0000
a7e38b
Subject: [PATCH] daemon/rpm-c.c: Disable signature checking in librpm
a7e38b
a7e38b
Older distros (eg CentOS 6) used SHA-1 RPM package signatures which
a7e38b
some newer distros (eg RHEL 9.0) prevent us from verifying.
a7e38b
a7e38b
This resulted in packages with SHA-1 signatures being skipped by
a7e38b
librpm (there is a warning in debug output, but if you're not looking
a7e38b
at that then the package is silently ignored).  In some cases
a7e38b
essential packages like the kernel were skipped, which would be
a7e38b
visible as a failure of virt-v2v.  In other cases (eg virt-inspector)
a7e38b
you'd just see fewer installed packages in the <applications> list.
a7e38b
a7e38b
Since verifying package signatures is not essential for inspection,
a7e38b
disable this feature in librpm.
a7e38b
a7e38b
Reported-by: Xiaodai Wang
a7e38b
Thanks: Panu Matilainen
a7e38b
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2064182
a7e38b
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
a7e38b
(cherry picked from commit aa6f8038f826bfb37ddbbb575e6962e1e181c5e8)
a7e38b
---
a7e38b
 daemon/rpm-c.c | 5 +++++
a7e38b
 1 file changed, 5 insertions(+)
a7e38b
a7e38b
diff --git a/daemon/rpm-c.c b/daemon/rpm-c.c
a7e38b
index be0e81e22..020fc588e 100644
a7e38b
--- a/daemon/rpm-c.c
a7e38b
+++ b/daemon/rpm-c.c
a7e38b
@@ -90,7 +90,12 @@ value
a7e38b
 guestfs_int_daemon_rpm_start_iterator (value unitv)
a7e38b
 {
a7e38b
   CAMLparam1 (unitv);
a7e38b
+
a7e38b
   ts = rpmtsCreate ();
a7e38b
+
a7e38b
+  /* Disable signature checking (RHBZ#2064182). */
a7e38b
+  rpmtsSetVSFlags (ts, rpmtsVSFlags (ts) | RPMVSF_MASK_NOSIGNATURES);
a7e38b
+
a7e38b
   iter = rpmtsInitIterator (ts, RPMDBI_PACKAGES, NULL, 0);
a7e38b
   CAMLreturn (Val_unit);
a7e38b
 }
a7e38b
-- 
a7e38b
2.31.1
a7e38b