From a909a54a920173cf93edde8596bb9743bbe50807 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Apr 04 2019 00:34:20 +0000 Subject: virt-manager-2.1.0-2.fc31 Fix --initrd-inject with f30 URLs (bz #1686464) --- diff --git a/0001-initrdinject-Use-full-option-versions-for-cpio.patch b/0001-initrdinject-Use-full-option-versions-for-cpio.patch new file mode 100644 index 0000000..3ce130c --- /dev/null +++ b/0001-initrdinject-Use-full-option-versions-for-cpio.patch @@ -0,0 +1,25 @@ +From: Cole Robinson +Date: Tue, 2 Apr 2019 15:02:47 -0400 +Subject: [PATCH virt-manager] initrdinject: Use full option versions for cpio + +Makes it more self documenting IMO + +(cherry picked from commit 309840b9535b0e1965ed177b4558652faa256b36) +--- + virtinst/initrdinject.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/virtinst/initrdinject.py b/virtinst/initrdinject.py +index 78c18c28..9a09f20c 100644 +--- a/virtinst/initrdinject.py ++++ b/virtinst/initrdinject.py +@@ -30,7 +30,8 @@ def perform_initrd_injections(initrd, injections, scratchdir): + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=tempdir) +- cpio_proc = subprocess.Popen(['cpio', '-o', '--null', '-Hnewc', '--quiet'], ++ cpio_proc = subprocess.Popen(['cpio', '--create', '--null', '--quiet', ++ '--format=newc'], + stdin=find_proc.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, diff --git a/0002-initrdinject-Force-added-files-to-be-owned-as-root-b.patch b/0002-initrdinject-Force-added-files-to-be-owned-as-root-b.patch new file mode 100644 index 0000000..881c1de --- /dev/null +++ b/0002-initrdinject-Force-added-files-to-be-owned-as-root-b.patch @@ -0,0 +1,33 @@ +From: Cole Robinson +Date: Wed, 3 Apr 2019 18:07:12 -0400 +Subject: [PATCH virt-manager] initrdinject: Force added files to be owned as + root (bz 1686464) + +systemd in fedora30 has some new security restriction about non-root +owned directories. Initrd inject would tickle this because the cpio +archive would cause the root dir in the initrd to be owned by the +uid that launched virt-install. + +Pass --owner=+0:+0 to cpio to force root ownership + +Suggested-by: James Szinger + +https://bugzilla.redhat.com/show_bug.cgi?id=1686464 +(cherry picked from commit c6b5f22fa61d87557b5fab23be080073d2f7906e) +--- + virtinst/initrdinject.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/virtinst/initrdinject.py b/virtinst/initrdinject.py +index 9a09f20c..4032f9ba 100644 +--- a/virtinst/initrdinject.py ++++ b/virtinst/initrdinject.py +@@ -31,7 +31,7 @@ def perform_initrd_injections(initrd, injections, scratchdir): + stderr=subprocess.PIPE, + cwd=tempdir) + cpio_proc = subprocess.Popen(['cpio', '--create', '--null', '--quiet', +- '--format=newc'], ++ '--format=newc', '--owner=+0:+0'], + stdin=find_proc.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, diff --git a/virt-manager.spec b/virt-manager.spec index ad782b9..d960a64 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -17,7 +17,7 @@ Name: virt-manager Version: 2.1.0 -Release: 1%{?dist} +Release: 2%{?dist} %global verrel %{version}-%{release} Summary: Desktop tool for managing virtual machines via libvirt @@ -26,6 +26,10 @@ BuildArch: noarch URL: https://virt-manager.org/ Source0: https://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz +# Fix --initrd-inject with f30 URLs (bz #1686464) +Patch0001: 0001-initrdinject-Use-full-option-versions-for-cpio.patch +Patch0002: 0002-initrdinject-Force-added-files-to-be-owned-as-root-b.patch + Requires: virt-manager-common = %{verrel} Requires: python3-gobject @@ -104,6 +108,10 @@ machine). %prep %setup -q +# Fix --initrd-inject with f30 URLs (bz #1686464) +%patch0001 -p1 +%patch0002 -p1 + %build %if %{default_hvs} @@ -177,6 +185,9 @@ done %changelog +* Wed Apr 03 2019 Cole Robinson - 2.1.0-2 +- Fix --initrd-inject with f30 URLs (bz #1686464) + * Sun Feb 03 2019 Cole Robinson - 2.1.0-1 - Rebased to version 2.1.0 - Bash autocompletion support (Lin Ma, Cole Robinson)