Don't run policykit checks when root (rhbz #436994)

This commit is contained in:
Daniel P. Berrange 2008-03-13 18:02:05 +00:00
parent 9d5868ee9e
commit 8f227e7db7
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,14 @@
diff -rup virt-manager-0.5.4.orig/src/virtManager/connection.py virt-manager-0.5.4/src/virtManager/connection.py
--- virt-manager-0.5.4.orig/src/virtManager/connection.py 2008-03-10 20:17:51.000000000 -0400
+++ virt-manager-0.5.4/src/virtManager/connection.py 2008-03-13 13:51:14.000000000 -0400
@@ -336,6 +336,9 @@ class vmmConnection(gobject.GObject):
self.connectThread.start()
def _do_creds_polkit(self, action):
+ if os.getuid() == 0:
+ logging.debug("Skipping policykit check as root")
+ return 0
logging.debug("Doing policykit for %s" % action)
bus = dbus.SessionBus()
obj = bus.get_object("org.gnome.PolicyKit", "/org/gnome/PolicyKit/Manager")
Only in virt-manager-0.5.4/src/virtManager: connection.py~

View File

@ -8,7 +8,7 @@
Name: virt-manager
Version: 0.5.4
Release: 1%{_extra_release}
Release: 2%{_extra_release}
Summary: Virtual Machine Manager
Group: Applications/Emulators
@ -17,6 +17,7 @@ URL: http://virt-manager.org/
Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz
Source1: %{name}.pam
Source2: %{name}.console
Patch1: %{name}-%{version}-polkit-root.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# These two are just the oldest version tested
@ -68,6 +69,7 @@ API.
%prep
%setup -q
%patch1 -p1
%build
%configure
@ -158,6 +160,9 @@ fi
%{_datadir}/dbus-1/services/%{name}.service
%changelog
* Thu Mar 13 2008 Daniel P. Berrange <berrange@redhat.com> - 0.5.4-2.fc9
- Don't run policykit checks when root (rhbz #436994)
* Mon Mar 10 2008 Daniel P. Berrange <berrange@redhat.com> - 0.5.4-1.fc9
- Update to 0.5.4 release