Blame SOURCES/sos-bz1964499-obfuscate-fqdn-from-dnf-log.patch

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