From 44a71b3a3e8ca79f1300e7e2f444c49eb3a54175dfc0b70743684a2f64f620ad Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Mon, 16 Mar 2015 16:59:15 +0000 Subject: [PATCH] Accepting request 291007 from home:flavio_castelli:branches:Virtualization - Instruct polkit to allow memebers of the 'libvirt' group to connect to libvirt without providing any password (bnc#920804) - Added polkit-10-virt.rules to fix bnc#920804 OBS-URL: https://build.opensuse.org/request/show/291007 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=444 --- libvirt.changes | 7 +++++++ libvirt.spec | 9 +++++++++ polkit-10-virt.rules | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 polkit-10-virt.rules diff --git a/libvirt.changes b/libvirt.changes index 7bdea3e..97c91f3 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 12 07:48:35 UTC 2015 - fcastelli@suse.com + +- Instruct polkit to allow memebers of the 'libvirt' group to connect + to libvirt without providing any password (bnc#920804) +- Added polkit-10-virt.rules to fix bnc#920804 + ------------------------------------------------------------------- Wed Mar 11 09:29:29 MDT 2015 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index aa89a51..9c75f93 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -363,6 +363,7 @@ BuildRequires: cyrus-sasl-devel %endif %if %{with_polkit} %if 0%{?suse_version} > 1110 +BuildRequires: polkit >= 0.9 BuildRequires: polkit-devel >= 0.9 %else BuildRequires: PolicyKit-devel >= 0.6 @@ -432,6 +433,7 @@ Source1: %{name}-%{version}.tar.gz.asc Source2: %{name}.keyring Source3: libvirtd.init Source4: libvirtd-relocation-server.fw +Source5: polkit-10-virt.rules Source99: baselibs.conf # Upstream patches # Patches pending upstream review @@ -1338,6 +1340,12 @@ mkdir -p $RPM_BUILD_ROOT%{_sbindir} ln -s %{_sysconfdir}/init.d/libvirt-guests $RPM_BUILD_ROOT%{_sbindir}/rclibvirt-guests %endif mv $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/libvirt-guests $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/sysconfig.libvirt-guests +%if %{with_polkit} + %if 0%{?suse_version} > 1110 +install -d $RPM_BUILD_ROOT%{_sysconfdir}/polkit-1/rules.d/ +install %SOURCE5 $RPM_BUILD_ROOT%{_sysconfdir}/polkit-1/rules.d/10-virt.rules + %endif +%endif %fdupes -s $RPM_BUILD_ROOT %clean @@ -1504,6 +1512,7 @@ fi %if %{with_polkit} %if 0%{?suse_version} > 1110 %{_datadir}/polkit-1/actions/org.libvirt.unix.policy +%{_sysconfdir}/polkit-1/rules.d/10-virt.rules %else %{_datadir}/PolicyKit/policy/org.libvirt.unix.policy %endif diff --git a/polkit-10-virt.rules b/polkit-10-virt.rules new file mode 100644 index 0000000..0fcb521 --- /dev/null +++ b/polkit-10-virt.rules @@ -0,0 +1,8 @@ +polkit.addRule(function(action, subject) { + if (action.id == "org.libvirt.unix.manage" + && subject.local + && subject.active + && subject.isInGroup("libvirt")) { + return polkit.Result.YES; + } +});