aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2020-09-17 10:28:25 -0400
committerJake Hunsaker <jhunsake@redhat.com>2020-09-21 11:56:40 -0400
commit0ec8dbcb66cd55960b5ef56bf7a7db61dcf05ec2 (patch)
treeea6d0b820631a8c3640d48731cc250296a6d35fa
parentfa1a42aaedc5b31b170b16b2562942206c6f88f3 (diff)
downloadsos-0ec8dbcb66cd55960b5ef56bf7a7db61dcf05ec2.tar.gz
[obfuscation_archive] Fix tarball skipping regex
The regex used to skip tarballs was slightly too vague, in that we were checking for any characters following 'tar', instead of any characters following 'tar.'. This in turn lead to the potential for skipping files that included the original sosreport archive's name. Make the regex more exact to no longer make these accidental matches, and only match on true tarballs. Closes: #2236 Resolves: #2238 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/cleaner/obfuscation_archive.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sos/cleaner/obfuscation_archive.py b/sos/cleaner/obfuscation_archive.py
index 1fe37d25..48012622 100644
--- a/sos/cleaner/obfuscation_archive.py
+++ b/sos/cleaner/obfuscation_archive.py
@@ -73,7 +73,9 @@ class SoSObfuscationArchive():
'sys/kernel/debug',
'sys/module',
'var/log/.*dnf.*',
- '.*.tar.*', # TODO: support archive unpacking
+ '.*\.tar$', # TODO: support archive unpacking
+ # Be explicit with these tar matches to avoid matching commands
+ '.*\.tar\.xz',
'.*.gz'
]