Skip to content

Commit

Permalink
[obfuscation_archive] Fix tarball skipping regex
Browse files Browse the repository at this point in the history
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: sosreport#2236
Resolves: sosreport#2238

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
  • Loading branch information
TurboTurtle committed Sep 17, 2020
1 parent ca7cb34 commit fec409c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sos/cleaner/obfuscation_archive.py
Expand Up @@ -73,7 +73,9 @@ def _load_skip_list(self):
'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'
]

Expand Down

0 comments on commit fec409c

Please sign in to comment.