aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Jansky <jjansky@redhat.com>2023-03-31 13:29:35 +0200
committerJake Hunsaker <jhunsake@redhat.com>2023-03-31 12:28:07 -0400
commitb4dbe0bbb96c5fc356414e8aa447b42be2a17154 (patch)
tree2a64f7f74d7e289f56af407ac7e94df0476c97ff
parentf3576ceec81726671cd323043359c138ff82ecd6 (diff)
downloadsos-b4dbe0bbb96c5fc356414e8aa447b42be2a17154.tar.gz
[tmpfiles] ignoring cleanup on /var/tmp/sos*
tmpfiles relocated to separated folder, added tmpfilesd-sos-rh.conf which ignoring tmpfiles clean on /var/tmp/sos*. This is introduced due to wrong selinux context on some collected files in temporal /var/tmp/sos or /var/tmp/sosreport which generate avc denials from tmpfiles or even repeated denials when --build option is used. Related: RHBZ#1664651 Resolves: #3180 Signed-off-by: Jan Jansky <jjansky@redhat.com>
-rw-r--r--setup.py2
-rw-r--r--sos.spec3
-rw-r--r--tmpfiles/tmpfilesd-sos-rh.conf4
-rw-r--r--tmpfiles/tmpfilesd-sos.conf (renamed from tmpfilesd-sos.conf)0
4 files changed, 8 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 30856907..c6ebb95c 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,7 @@ setup(
('share/man/man5', ['man/en/sos.conf.5']),
('share/licenses/sos', ['LICENSE']),
('share/doc/sos', ['AUTHORS', 'README.md']),
- ('config', ['sos.conf'])
+ ('config', ['sos.conf', 'tmpfiles/tmpfilesd-sos-rh.conf'])
],
packages=find_packages(include=['sos', 'sos.*'])
)
diff --git a/sos.spec b/sos.spec
index a6689949..9a933dbf 100644
--- a/sos.spec
+++ b/sos.spec
@@ -37,7 +37,9 @@ install -d -m 700 ${RPM_BUILD_ROOT}/etc/sos/cleaner
install -d -m 755 ${RPM_BUILD_ROOT}/etc/sos/presets.d
install -d -m 755 ${RPM_BUILD_ROOT}/etc/sos/groups.d
install -d -m 755 ${RPM_BUILD_ROOT}/etc/sos/extras.d
+install -d -m 755 ${RPM_BUILD_ROOT}/etc/tmpfiles.d/
install -m 644 %{name}.conf ${RPM_BUILD_ROOT}/etc/sos/%{name}.conf
+install -m 644 tmpfiles/tmpfilesd-sos-rh.conf ${RPM_BUILD_ROOT}/etc/tmpfiles.d/%{name}.conf
rm -rf ${RPM_BUILD_ROOT}/usr/config/
@@ -53,6 +55,7 @@ rm -rf ${RPM_BUILD_ROOT}/usr/config/
%dir /etc/sos/presets.d
%dir /etc/sos/extras.d
%dir /etc/sos/groups.d
+/etc/tmpfiles.d/%{name}.conf
%{python3_sitelib}/*
%{_mandir}/man1/*
%{_mandir}/man5/*
diff --git a/tmpfiles/tmpfilesd-sos-rh.conf b/tmpfiles/tmpfilesd-sos-rh.conf
new file mode 100644
index 00000000..11d56d7e
--- /dev/null
+++ b/tmpfiles/tmpfilesd-sos-rh.conf
@@ -0,0 +1,4 @@
+# Ignore the contents of extracted sosreport directories.
+#
+# Type Path Mode User Group Age Argument
+x /var/tmp/sos*
diff --git a/tmpfilesd-sos.conf b/tmpfiles/tmpfilesd-sos.conf
index f76b357b..f76b357b 100644
--- a/tmpfilesd-sos.conf
+++ b/tmpfiles/tmpfilesd-sos.conf