Sophie

Sophie

distrib > Fedora > 19 > x86_64 > by-pkgid > 2183d0e55a8d454b8164909066cf1904 > files > 65

sos-3.1-1.fc19.src.rpm

From 7c16f07f889dd6de071544301a17ec4c4ee76d5d Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Thu, 5 Jun 2014 12:31:14 -0400
Subject: [PATCH 66/72] [ovirt] elide passwords in {iso,image}uploader.conf

These two configuration files may contain passwords of the form:

Add do_file_sub() calls to the plugin's postproc to remove these.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/plugins/ovirt.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sos/plugins/ovirt.py b/sos/plugins/ovirt.py
index e245e9b..969440b 100644
--- a/sos/plugins/ovirt.py
+++ b/sos/plugins/ovirt.py
@@ -120,6 +120,18 @@ class Ovirt(Plugin, RedHatPlugin):
             r"proxyPassword=********"
         )
 
+        passwd_files = [
+            "imageuploader.conf",
+            "isouploader.conf"
+        ]
+        for conf_file in passwd_files:
+            conf_path = os.path.join("/etc/ovirt-engine", conf_file)
+            self.do_file_sub(
+                conf_path,
+                r"passwd=(.*)",
+                r"passwd=********"
+            )
+
         sensitive_keys = self.DEFAULT_SENSITIVE_KEYS
         #Handle --alloptions case which set this to True.
         keys_opt = self.get_option('sensitive_keys')
-- 
1.9.3