Blame SOURCES/sos-bz1891562-tmp-dir-relative-path.patch

8bcace
From c07bdbc94269603d2b910ccafa289512478160aa Mon Sep 17 00:00:00 2001
8bcace
From: Jake Hunsaker <jhunsake@redhat.com>
8bcace
Date: Mon, 26 Oct 2020 14:11:56 -0400
8bcace
Subject: [PATCH] [sos] Fix use of relative paths for --tmp-dir
8bcace
8bcace
Fixes an issue where the use of relative paths for `--tmp-dir` causes a
8bcace
failure in the building of the final archive. Previously, a relative
8bcace
path would cause the tarball to be produced in a nested directory under
8bcace
the temp directory of the same name, which would in turn cause
8bcace
compression and all further operations for the archive to fail.
8bcace
8bcace
Fix this by converting relative paths in the option to the absolute path
8bcace
internally.
8bcace
8bcace
Resolves: RHBZ#1891562
8bcace
8bcace
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
8bcace
---
8bcace
 sos/component.py | 2 +-
8bcace
 1 file changed, 1 insertion(+), 1 deletion(-)
8bcace
8bcace
diff --git a/sos/component.py b/sos/component.py
8bcace
index 0aef770c6..b44fdf829 100644
8bcace
--- a/sos/component.py
8bcace
+++ b/sos/component.py
8bcace
@@ -138,7 +138,7 @@ def get_tmpdir_default(self):
8bcace
         use a standardized env var to redirect to the host's filesystem instead
8bcace
         """
8bcace
         if self.opts.tmp_dir:
8bcace
-            return self.opts.tmp_dir
8bcace
+            return os.path.abspath(self.opts.tmp_dir)
8bcace
 
8bcace
         tmpdir = '/var/tmp'
8bcace