From dc5090c7482cb661ac5f7406b0b7d95929dc5c38 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Apr 21 2009 17:19:02 +0000 Subject: Only warn if selinux labeling appears to be wrong (bz 496340) --- diff --git a/python-virtinst.spec b/python-virtinst.spec index f37215f..df328a3 100644 --- a/python-virtinst.spec +++ b/python-virtinst.spec @@ -17,7 +17,7 @@ Summary: Python modules and utilities for installing virtual machines Name: python-%{appname} Version: 0.400.3 -Release: 6%{_extra_release} +Release: 7%{_extra_release} Source0: http://virt-manager.org/download/sources/%{appname}/%{appname}-%{version}.tar.gz Patch1: %{appname}-%{version}-fix-virtimage-scratch.patch Patch2: %{appname}-%{version}-hostdev-libvirt-calls.patch @@ -29,6 +29,8 @@ Patch5: %{appname}-%{version}-no-default-keymap.patch Patch6: %{appname}-%{version}-fix-floppy-dev.patch # F11 Translations (bz 493944 and bz 494358) Patch7: %{appname}-%{version}-updated-trans.patch +# Only throw warnings if we fail to relabel install media (bz 496340) +Patch8: %{appname}-%{version}-selinux-warn.patch License: GPLv2+ Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -62,6 +64,7 @@ and install new VMs) and virt-clone (clone an existing virtual machine). %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 %build python setup.py build @@ -97,6 +100,9 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/virt-convert %changelog +* Tue Apr 21 2009 Cole Robinson - 0.400.3-7.fc11 +- Only warn if selinux labeling appears to be wrong (bz 496340) + * Tue Apr 14 2009 Cole Robinson - 0.400.3-6.fc11 - More translation updates diff --git a/virtinst-0.400.3-selinux-warn.patch b/virtinst-0.400.3-selinux-warn.patch new file mode 100644 index 0000000..0b305c1 --- /dev/null +++ b/virtinst-0.400.3-selinux-warn.patch @@ -0,0 +1,40 @@ +diff -rup virtinst-0.400.3/virtinst/VirtualDisk.py new/virtinst/VirtualDisk.py +--- virtinst-0.400.3/virtinst/VirtualDisk.py 2009-04-20 13:09:36.000000000 -0400 ++++ new/virtinst/VirtualDisk.py 2009-04-20 13:59:00.000000000 -0400 +@@ -678,8 +678,9 @@ class VirtualDisk(VirtualDevice): + return + + if self._is_remote(): +- raise ValueError, _("Install volume %s has incorrect SELinux label %s, expecting %s" % +- (self.path, label, wantLabel)) ++ logging.warn(_("Install volume %s has incorrect SELinux " ++ "label %s, expecting %s") % ++ (self.path, label, wantLabel)) + else: + changeLabel = True + elif self.path: +@@ -691,8 +692,9 @@ class VirtualDisk(VirtualDevice): + return + + if self._is_remote(): +- raise ValueError, _("Install volume %s has incorrect SELinux label %s, expecting %s" % +- (self.path, label, wantLabel)) ++ logging.warn(_("Install volume %s has incorrect SELinux " ++ "label %s, expecting %s") % ++ (self.path, label, wantLabel)) + else: + if self.path[0:4] == "/dev": + logging.info("Not changing context on physical device") +@@ -707,8 +709,10 @@ class VirtualDisk(VirtualDevice): + selinux.setfilecon(self.path, wantLabel) + logging.info("Changed SELinux label to %s" % wantLabel) + except Exception, e: +- raise ValueError, _(("Unable to fix install volume SELinux labelling: %s\n" % str(e)) + +- ("Please run 'chcon %s %s' manually and retry installation" % (wantLabel, self.path))) ++ logging.warn(_(("Unable to fix install volume SELinux " ++ "labelling: %s\n") % str(e)+ "Please run " ++ "'chcon %s %s' manually and retry " ++ "installation" % (wantLabel, self.path))) + + + def get_xml_config(self, disknode=None):