[libvirt] [PATCH] spec: Unconditionally set ownership of /var/lib/libvirt/sanlock

Jiri Denemark posted 1 patch 4 years, 11 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/8985520e762a086873a6339fab0b4591a5692ff2.1558437335.git.jdenemar@redhat.com
libvirt.spec.in | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
[libvirt] [PATCH] spec: Unconditionally set ownership of /var/lib/libvirt/sanlock
Posted by Jiri Denemark 4 years, 11 months ago
The libvirt-lock-sanlock subpackage requires sanlock to be installed
first and the sanlock package creates the sanlock group on all distros
we care about in the spec file (Fedora and RHEL >= 7). Thus instead of
setting the ownership and permissions in a post scriptlet only when the
sanlock group exists we can just install the directory with the
appropriate metadata.

https://bugzilla.redhat.com/show_bug.cgi?id=1702758

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 libvirt.spec.in | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index b159c50d8f..5bd3e30509 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1479,14 +1479,6 @@ exit 0
 %postun client
 %systemd_postun libvirt-guests.service
 
-%if %{with_sanlock}
-%post lock-sanlock
-if getent group sanlock > /dev/null ; then
-    chmod 0770 %{_localstatedir}/lib/libvirt/sanlock
-    chown root:sanlock %{_localstatedir}/lib/libvirt/sanlock
-fi
-%endif
-
 %if %{with_lxc}
 %pre login-shell
 getent group virtlogin >/dev/null || groupadd -r virtlogin
@@ -1739,7 +1731,7 @@ exit 0
 %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
 %{_datadir}/augeas/lenses/libvirt_sanlock.aug
 %{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
-%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/sanlock
+%dir %attr(0770, root, sanlock) %{_localstatedir}/lib/libvirt/sanlock
 %{_sbindir}/virt-sanlock-cleanup
 %{_mandir}/man8/virt-sanlock-cleanup.8*
 %attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] spec: Unconditionally set ownership of /var/lib/libvirt/sanlock
Posted by Michal Privoznik 4 years, 11 months ago
On 5/21/19 1:15 PM, Jiri Denemark wrote:
> The libvirt-lock-sanlock subpackage requires sanlock to be installed
> first and the sanlock package creates the sanlock group on all distros
> we care about in the spec file (Fedora and RHEL >= 7). Thus instead of
> setting the ownership and permissions in a post scriptlet only when the
> sanlock group exists we can just install the directory with the
> appropriate metadata.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1702758
> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>   libvirt.spec.in | 10 +---------
>   1 file changed, 1 insertion(+), 9 deletions(-)

ACK

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list