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

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