Change in vdsm[master]: Support for the new polkit rules
fsimonce at redhat.com
fsimonce at redhat.com
Wed Sep 26 13:41:35 UTC 2012
Federico Simoncelli has uploaded a new change for review.
Change subject: Support for the new polkit rules
......................................................................
Support for the new polkit rules
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=829884
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
Change-Id: I5de52881c60c54cd4874a8801d2705d0681f0824
---
M vdsm.spec.in
A vdsm/vdsm-libvirt-access.rule
2 files changed, 22 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/8213/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 95f405a..e399c07 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -11,7 +11,11 @@
%global snlk_user @SNLKUSER@
# Required paths
+%if 0%{?fedora} >= 18
+%global _polkitdir %{_datadir}/polkit-1/rules.d
+%else
%global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d
+%endif
# Default to skipping autoreconf. Distros can change just this one line
# (or provide a command-line override) if they backport any patches that
@@ -397,9 +401,15 @@
%{buildroot}/lib/systemd/systemd-vdsm-reg
install -Dm 0644 vdsm_reg/vdsm-reg.service \
%{buildroot}%{_unitdir}/vdsm-reg.service
+
# Install the polkit for libvirt
+%if 0%{?fedora} >= 18
+install -Dm 0644 vdsm/vdsm-libvirt-access.rule \
+ %{buildroot}%{_polkitdir}/10-vdsm-libvirt-access.rule
+%else
install -Dm 0644 vdsm/vdsm-libvirt-access.pkla \
%{buildroot}%{_polkitdir}/10-vdsm-libvirt-access.pkla
+%endif
%endif
%check
@@ -705,8 +715,12 @@
%if 0%{?rhel}
%dir %{_localstatedir}/log/core
%else
+%if 0%{?fedora} >= 18
+%{_polkitdir}/10-vdsm-libvirt-access.rule
+%else
%{_polkitdir}/10-vdsm-libvirt-access.pkla
%endif
+%endif
%defattr(-, %{vdsm_user}, %{qemu_group}, -)
%dir %{_localstatedir}/lib/libvirt/qemu/channels
diff --git a/vdsm/vdsm-libvirt-access.rule b/vdsm/vdsm-libvirt-access.rule
new file mode 100644
index 0000000..959078b
--- /dev/null
+++ b/vdsm/vdsm-libvirt-access.rule
@@ -0,0 +1,8 @@
+# VDSM libvirt management permissions
+
+polkit.addRule(function(action, subject) {
+ if (action.id == "org.libvirt.unix.manage" &&
+ subject.user == "vdsm") {
+ return polkit.Result.YES;
+ }
+});
--
To view, visit http://gerrit.ovirt.org/8213
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5de52881c60c54cd4874a8801d2705d0681f0824
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
More information about the vdsm-patches
mailing list