Skip to content

Commit

Permalink
[tmpfiles] ignoring cleanup on /var/tmp/sos*
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jjansky1 authored and TurboTurtle committed Mar 31, 2023
1 parent f3576ce commit b4dbe0b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
('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.*'])
)
Expand Down
3 changes: 3 additions & 0 deletions sos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand All @@ -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/*
Expand Down
4 changes: 4 additions & 0 deletions tmpfiles/tmpfilesd-sos-rh.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore the contents of extracted sosreport directories.
#
# Type Path Mode User Group Age Argument
x /var/tmp/sos*
File renamed without changes.

0 comments on commit b4dbe0b

Please sign in to comment.