diff --git a/0003-component-Fix-regression-57bbc89-in-toolbox-containe.patch b/0003-component-Fix-regression-57bbc89-in-toolbox-containe.patch new file mode 100644 index 0000000..cfdd658 --- /dev/null +++ b/0003-component-Fix-regression-57bbc89-in-toolbox-containe.patch @@ -0,0 +1,36 @@ +From c0e514894b2c35c2b36f247f8b84dd4311034fb6 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Fri, 12 Sep 2025 11:36:02 +0200 +Subject: [PATCH] [component] Fix regression 57bbc89 in toolbox containers + +57bbc89 commit set tmpdir to source the dir from Policy. Which means +HOST sysroot directory is newly applied already in +LinuxPolicy._container_init method. + +Removed lines mimic the same in a worse way, so let drop them here. + +Resolves: #4116 +Closes: #4118 + +Signed-off-by: Pavel Moravec +--- + sos/component.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/sos/component.py b/sos/component.py +index a110c270..3e53fe3d 100644 +--- a/sos/component.py ++++ b/sos/component.py +@@ -170,9 +170,6 @@ class SoSComponent(): + else: + tmpdir = os.getenv('TMPDIR', None) or self.policy.get_tmp_dir(None) + +- if os.getenv('HOST', None) and os.getenv('container', None): +- tmpdir = os.path.join(os.getenv('HOST'), tmpdir.lstrip('/')) +- + # no standard library method exists for this, so call out to stat to + # avoid bringing in a dependency on psutil + self.tmpfstype = shell_out( +-- +2.49.0 + diff --git a/0004-revert-PR4092.patch b/0004-revert-PR4092.patch new file mode 100644 index 0000000..04539d0 --- /dev/null +++ b/0004-revert-PR4092.patch @@ -0,0 +1,49 @@ +--- a/sos/upload/targets/__init__.py 2025-09-16 19:57:27.294642506 +0200 ++++ b/sos/upload/targets/__init__.py 2025-09-16 19:59:44.498573843 +0200 +@@ -465,7 +465,7 @@ + self.upload_password or + self._upload_password) + +- def upload_sftp(self, user=None, password=None, user_dir=None): ++ def upload_sftp(self, user=None, password=None): + """Attempts to upload the archive to an SFTP location. + + Due to the lack of well maintained, secure, and generally widespread +@@ -540,13 +540,10 @@ + raise Exception("Unable to connect via SFTP to " + f"{self.get_upload_url_string()}") + +- # certain implementations require file to be put in the user dir +- put_cmd = ( +- f"put {self.upload_archive_name} " +- f"{f'{user_dir}/' if user_dir else ''}" +- f"{self._get_sftp_upload_name()}" +- ) ++ put_cmd = (f'put {self.upload_archive_name} ' ++ f'{self._get_sftp_upload_name()}') + ret.sendline(put_cmd) ++ + put_expects = [ + '100%', + pexpect.TIMEOUT, +--- a/sos/upload/targets/redhat.py 2025-09-16 19:57:36.804628207 +0200 ++++ b/sos/upload/targets/redhat.py 2025-09-16 20:00:52.578728154 +0200 +@@ -145,7 +145,7 @@ + return fname + + # pylint: disable=too-many-branches +- def upload_sftp(self, user=None, password=None, user_dir=None): ++ def upload_sftp(self, user=None, password=None): + """Override the base upload_sftp to allow for setting an on-demand + generated anonymous login for the RH SFTP server if a username and + password are not given +@@ -217,8 +217,7 @@ + f"{anon.status_code}): {anon.json()}" + ) + if _user and _token: +- return super().upload_sftp(user=_user, password=_token, +- user_dir=_user) ++ return super().upload_sftp(user=_user, password=_token) + raise Exception("Could not retrieve valid or anonymous credentials") + + def check_file_too_big(self, archive): diff --git a/sos.spec b/sos.spec index 629ffa2..b8c7a6f 100644 --- a/sos.spec +++ b/sos.spec @@ -5,7 +5,7 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 4.10.0 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz Source1: sos-audit-%{auditversion}.tgz @@ -25,6 +25,8 @@ Obsoletes: sos-collector <= 1.9 Patch1: sosreport-binary.patch Patch2: 0001-cleaner-Make-cleaner-s-obfuscate_file-properly-worki.patch Patch3: 0002-openstack_nova-Improve-scrubbing.patch +Patch4: 0003-component-Fix-regression-57bbc89-in-toolbox-containe.patch +Patch5: 0004-revert-PR4092.patch %description Sos is a set of tools that gathers information about system @@ -38,6 +40,8 @@ support technicians and developers. %patch -P 1 -p1 %patch -P 2 -p1 %patch -P 3 -p1 +%patch -P 4 -p1 +%patch -P 5 -p1 %build %py3_build @@ -109,8 +113,11 @@ of the system. Currently storage and filesystem commands are audited. %ghost /etc/audit/rules.d/40-sos-storage.rules %license LICENSE - %changelog +* Wed Sep 17 2025 Jan Jansky = 4.10.0-2 +- Update to 4.10.0-2 + Resolves: RHEL-113795 + * Thu Aug 21 2025 Jan Jansky = 4.10.0-1 - Update to 4.10.0 Resolves: RHEL-110500