From bdf0a9d235b10c3653fa7b7e970799c73c373091 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 16 Dec 2015 18:06:59 +0000 Subject: [PATCH] Ensure private temporary directory is removed --- sos-clean-up-private-temp.patch | 26 ++++++++++++++++++++++++++ sos.spec | 7 +++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 sos-clean-up-private-temp.patch diff --git a/sos-clean-up-private-temp.patch b/sos-clean-up-private-temp.patch new file mode 100644 index 0000000..b98e485 --- /dev/null +++ b/sos-clean-up-private-temp.patch @@ -0,0 +1,26 @@ +commit 08121d877741e33333a1ae01280f6898d7d4ca15 +Author: Bryn M. Reeves +Date: Thu Dec 10 11:50:49 2015 +0000 + + [sosreport] clean up private temporary directory + + Signed-off-by: Bryn M. Reeves + +diff --git a/sos/sosreport.py b/sos/sosreport.py +index fe251ed..bc7792a 100644 +--- a/sos/sosreport.py ++++ b/sos/sosreport.py +@@ -1544,7 +1544,12 @@ class SoSReport(object): + + self.policy.display_results(archive, directory, checksum) + +- self.tempfile_util.clean() ++ # clean up ++ if self.tempfile_util: ++ self.tempfile_util.clean() ++ if self.tmpdir: ++ rmtree(self.tmpdir) ++ + return True + + def verify_plugins(self): diff --git a/sos.spec b/sos.spec index 88c851b..f51c9a8 100644 --- a/sos.spec +++ b/sos.spec @@ -2,7 +2,7 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 3.2 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz License: GPLv2+ @@ -85,6 +85,7 @@ Patch67: sos-html-report-generate.patch Patch68: sos-collect-docker-daemon-logs.patch Patch69: sos-ceph-collect-var-lib-var-run.patch Patch70: sos-sosreport-prepare-report-in-a-private-subdirectory.patch +Patch71: sos-clean-up-private-temp.patch %description Sos is a set of tools that gathers information about system @@ -165,6 +166,7 @@ support technicians and developers. %patch68 -p1 %patch69 -p1 %patch70 -p1 +%patch71 -p1 %build %{__python3} setup.py build @@ -185,7 +187,8 @@ install -Dm644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf %config(noreplace) %{_sysconfdir}/sos.conf %changelog -* Wed Dec 16 2015 Bryn M. Reeves = 3.2-1 +* Wed Dec 16 2015 Bryn M. Reeves = 3.2-2 +- [sosreport] ensure private temporary directory is removed - [global] sync rawhide package with upstream - [ceph] collect /var/lib/ceph and /var/run/ceph - [sosreport] prepare report in a private subdirectory (CVE-2015-7529)