On Wed, Dec 31, 2008 at 01:50:09PM +0100, Guido Günther wrote:
> tags 510235 + patch
> 
> On Wed, Dec 31, 2008 at 01:20:33PM +0100, Guido Günther wrote:
> > The check in virt-manager is bogus anyways since you don't use policykit
> > but that's a different issue. I'll fix that.
> Attached patch fixes the issue for me.
Attached now.
 -- Guido
>From dd095406b303dbd83663e2114440397e277ef322 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Guido=20G=C3=BCnther?= <a...@sigxcpu.org>
Date: Wed, 31 Dec 2008 13:32:31 +0100
Subject: [PATCH] update policy file location

Closes: #510235
---
 src/virtManager/connection.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/virtManager/connection.py b/src/virtManager/connection.py
index e3fe863..0ac7d66 100644
--- a/src/virtManager/connection.py
+++ b/src/virtManager/connection.py
@@ -37,7 +37,10 @@ from virtManager.domain import vmmDomain
 from virtManager.network import vmmNetwork
 from virtManager.netdev import vmmNetDevice
 
-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:
@@ -125,7 +128,12 @@ class vmmConnection(gobject.GObject):
 
         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
-- 
1.6.0.3

Reply via email to