1
0
forked from rpms/sos
sos/SOURCES/sos-bz1964499-obfuscate-fqdn-from-dnf-log.patch

79 lines
2.8 KiB
Diff
Raw Normal View History

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