From e53fbd0923714f2b0b4454febe15eff545880ca0 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Tue, 8 Feb 2022 16:32:38 +0100 Subject: [PATCH] Set right ownership on /var/lib/setroubleshoot A system which uses rpm ostree doesn't install rpms but images which are pre-created in a build system. There's no guarantee that the build system has the same uid/gid mapping for setroubleshoot as the local system. systemd-tmpfiles's 'Z' type recursivelly sets the user and group ownership on every reboot. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2012943 --- setroubleshoot.spec | 5 +---- setroubleshoot.tmpfiles | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/setroubleshoot.spec b/setroubleshoot.spec index 39d6e4f..341bb53 100644 --- a/setroubleshoot.spec +++ b/setroubleshoot.spec @@ -81,7 +81,7 @@ touch %{buildroot}%{pkgdatabase} touch %{buildroot}%{pkgvardatadir}/email_alert_recipients rm -rf %{buildroot}/usr/share/doc/ # create /run/setroubleshoot on boot -install -m644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf +install -p -m644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf %find_lang %{name} @@ -121,9 +121,6 @@ getent passwd %{username} >/dev/null || useradd -r -U -s /sbin/nologin -d %{pkgv %postun server /sbin/service auditd reload >/dev/null 2>&1 || : -%triggerun server -- %{name}-server < 3.2.24-4 -chown -R setroubleshoot:setroubleshoot %{pkgvardatadir} - %files server -f %{name}.lang %{_bindir}/sealert %{_sbindir}/sedispatch diff --git a/setroubleshoot.tmpfiles b/setroubleshoot.tmpfiles index 8f68570..9e71e5f 100644 --- a/setroubleshoot.tmpfiles +++ b/setroubleshoot.tmpfiles @@ -1 +1,2 @@ d /run/setroubleshoot 711 setroubleshoot setroubleshoot - +Z /var/lib/setroubleshoot - setroubleshoot setroubleshoot -