|
|
ba407d |
From b27140a9126ea82efb517d60bf1b8455aaf4f5a6 Mon Sep 17 00:00:00 2001
|
|
|
ba407d |
From: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
ba407d |
Date: Fri, 26 Mar 2021 11:12:33 -0400
|
|
|
ba407d |
Subject: [PATCH] [cleaner] Only skip packaging-based files for the IP parser
|
|
|
ba407d |
|
|
|
ba407d |
Files primarily containing package information, e.g. `installed-rpms` or
|
|
|
ba407d |
`installed-debs`, were previously being skipped by all parsers. In
|
|
|
ba407d |
reality, we only need to skip these for the IP parser due to the fact
|
|
|
ba407d |
that version numbers often generate a match for IP address regexes.
|
|
|
ba407d |
|
|
|
ba407d |
This will also fix a problem where if a system was the build host for
|
|
|
ba407d |
certain packages, the hostname would remain in these files as the
|
|
|
ba407d |
hostname parser was previously not checking these files.
|
|
|
ba407d |
|
|
|
ba407d |
Closes: #2400
|
|
|
ba407d |
Resolves: #2464
|
|
|
ba407d |
|
|
|
ba407d |
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
ba407d |
---
|
|
|
ba407d |
sos/cleaner/obfuscation_archive.py | 10 ----------
|
|
|
ba407d |
sos/cleaner/parsers/ip_parser.py | 16 ++++++++++++++++
|
|
|
ba407d |
2 files changed, 16 insertions(+), 10 deletions(-)
|
|
|
ba407d |
|
|
|
ba407d |
diff --git a/sos/cleaner/obfuscation_archive.py b/sos/cleaner/obfuscation_archive.py
|
|
|
ba407d |
index 981cc05f..84ca30cd 100644
|
|
|
ba407d |
--- a/sos/cleaner/obfuscation_archive.py
|
|
|
ba407d |
+++ b/sos/cleaner/obfuscation_archive.py
|
|
|
ba407d |
@@ -59,20 +59,10 @@ class SoSObfuscationArchive():
|
|
|
ba407d |
Returns: list of files and file regexes
|
|
|
ba407d |
"""
|
|
|
ba407d |
return [
|
|
|
ba407d |
- 'installed-debs',
|
|
|
ba407d |
- 'installed-rpms',
|
|
|
ba407d |
- 'sos_commands/dpkg',
|
|
|
ba407d |
- 'sos_commands/python/pip_list',
|
|
|
ba407d |
- 'sos_commands/rpm',
|
|
|
ba407d |
- 'sos_commands/yum/.*list.*',
|
|
|
ba407d |
- 'sos_commands/snappy/snap_list_--all',
|
|
|
ba407d |
- 'sos_commands/snappy/snap_--version',
|
|
|
ba407d |
- 'sos_commands/vulkan/vulkaninfo',
|
|
|
ba407d |
'sys/firmware',
|
|
|
ba407d |
'sys/fs',
|
|
|
ba407d |
'sys/kernel/debug',
|
|
|
ba407d |
'sys/module',
|
|
|
ba407d |
- 'var/log/.*dnf.*',
|
|
|
ba407d |
r'.*\.tar$', # TODO: support archive unpacking
|
|
|
ba407d |
# Be explicit with these tar matches to avoid matching commands
|
|
|
ba407d |
r'.*\.tar\.xz',
|
|
|
ba407d |
diff --git a/sos/cleaner/parsers/ip_parser.py b/sos/cleaner/parsers/ip_parser.py
|
|
|
ba407d |
index 3ea7f865..08d1cd05 100644
|
|
|
ba407d |
--- a/sos/cleaner/parsers/ip_parser.py
|
|
|
ba407d |
+++ b/sos/cleaner/parsers/ip_parser.py
|
|
|
ba407d |
@@ -24,6 +24,22 @@ class SoSIPParser(SoSCleanerParser):
|
|
|
ba407d |
# don't match package versions recorded in journals
|
|
|
ba407d |
r'.*dnf\[.*\]:'
|
|
|
ba407d |
]
|
|
|
ba407d |
+
|
|
|
ba407d |
+ skip_files = [
|
|
|
ba407d |
+ # skip these as version numbers will frequently look like IP addresses
|
|
|
ba407d |
+ # when using regex matching
|
|
|
ba407d |
+ 'installed-debs',
|
|
|
ba407d |
+ 'installed-rpms',
|
|
|
ba407d |
+ 'sos_commands/dpkg',
|
|
|
ba407d |
+ 'sos_commands/python/pip_list',
|
|
|
ba407d |
+ 'sos_commands/rpm',
|
|
|
ba407d |
+ 'sos_commands/yum/.*list.*',
|
|
|
ba407d |
+ 'sos_commands/snappy/snap_list_--all',
|
|
|
ba407d |
+ 'sos_commands/snappy/snap_--version',
|
|
|
ba407d |
+ 'sos_commands/vulkan/vulkaninfo',
|
|
|
ba407d |
+ 'var/log/.*dnf.*'
|
|
|
ba407d |
+ ]
|
|
|
ba407d |
+
|
|
|
ba407d |
map_file_key = 'ip_map'
|
|
|
ba407d |
prep_map_file = 'sos_commands/networking/ip_-o_addr'
|
|
|
ba407d |
|
|
|
ba407d |
--
|
|
|
ba407d |
2.26.3
|
|
|
ba407d |
|