From e811baa04bae85bbc53f0bd6846c7255b873a468 Mon Sep 17 00:00:00 2001 From: Daniel P. Berrange Date: Oct 02 2008 11:56:48 +0000 Subject: Fix broken polkit check (rhbz #464069) --- diff --git a/virt-manager-0.5.4-polkit-check.patch b/virt-manager-0.5.4-polkit-check.patch new file mode 100644 index 0000000..e476592 --- /dev/null +++ b/virt-manager-0.5.4-polkit-check.patch @@ -0,0 +1,46 @@ +changeset: 830:2893744f29b0 +user: "Daniel P. Berrange " +date: Thu Aug 21 12:29:33 2008 +0100 +files: src/virtManager/connection.py +description: +Fix check for policykit + + +diff -r 043e6981cb84 -r 2893744f29b0 src/virtManager/connection.py +--- a/src/virtManager/connection.py Thu Aug 21 12:06:35 2008 +0100 ++++ b/src/virtManager/connection.py Thu Aug 21 12:29:33 2008 +0100 +@@ -38,7 +38,10 @@ + from virtManager.netdev import vmmNetDevice + from virtManager.storagepool import vmmStoragePool + +-LIBVIRT_POLICY_FILE = "/usr/share/PolicyKit/policy/libvirtd.policy" ++LIBVIRT_POLICY_FILES = [ ++ "/usr/share/PolicyKit/policy/libvirtd.policy", ++ "/usr/share/PolicyKit/policy/org.libvirt.unix.policy" ++] + + def get_local_hostname(): + try: +@@ -137,7 +140,12 @@ + + self.readOnly = readOnly + if not self.is_remote() and os.getuid() != 0 and self.uri != "qemu:///session": +- if not os.path.exists(LIBVIRT_POLICY_FILE): ++ hasPolkit = False ++ for f in LIBVIRT_POLICY_FILES: ++ if os.path.exists(f): ++ hasPolkit = True ++ ++ if not hasPolkit: + self.readOnly = True + + self.state = self.STATE_DISCONNECTED +@@ -460,6 +468,7 @@ + try: + flags = 0 + if self.readOnly: ++ logging.info("Caller requested read only connection") + flags = libvirt.VIR_CONNECT_RO + + self.vmm = libvirt.openAuth(self.uri, + diff --git a/virt-manager.spec b/virt-manager.spec index 86a343a..cc44b05 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -8,7 +8,7 @@ Name: virt-manager Version: 0.5.4 -Release: 4%{_extra_release} +Release: 5%{_extra_release} Summary: Virtual Machine Manager Group: Applications/Emulators @@ -20,6 +20,7 @@ Source2: %{name}.console Patch1: %{name}-%{version}-polkit-root.patch Patch2: %{name}-%{version}-i18n.patch Patch3: %{name}-%{version}-image-dir.patch +Patch4: %{name}-%{version}-polkit-check.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # These two are just the oldest version tested @@ -74,6 +75,7 @@ API. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build %configure @@ -164,6 +166,9 @@ fi %{_datadir}/dbus-1/services/%{name}.service %changelog +* Thu Oct 2 2008 Daniel P. Berrange - 0.5.4-5.fc9 +- Fix polkit policy file check (rhbz #464069) + * Fri May 9 2008 Daniel P. Berrange - 0.5.4-4.fc9 - Default disk images to /var/lib/libvirt/images