Blame SOURCES/sos-bz1925419-gluster-pubkeys-statusfile.patch

264a38
From 51e8213fd3a83e717fe7ef35d48d5c541b077c5f Mon Sep 17 00:00:00 2001
264a38
From: Jose Castillo <jcastillo@redhat.com>
264a38
Date: Mon, 8 Feb 2021 16:25:34 +0100
264a38
Subject: [PATCH] [gluster] Add glusterd public keys and status files
264a38
264a38
This patch helps capture some missing files in the
264a38
gluster plugin, i.e.:
264a38
264a38
Files inside /var/lib/glusterd/glusterfind, like
264a38
*.status files, that store the required timestamps,
264a38
*.pem.pub files, that store ssh public keys.
264a38
We also need to omit the glusterfind_*_secret.pem,
264a38
which contains the openssh private key.
264a38
264a38
Files inside /var/lib/glusterd/.keys, that contains
264a38
*.pem.pub,  the ssh public key.
264a38
264a38
Closes: RHBZ#1925035, RHBZ#1925419
264a38
264a38
Resolves: #2411
264a38
264a38
Signed-off-by: Jose Castillo <jcastillo@redhat.com>
264a38
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
264a38
---
264a38
 sos/report/plugins/gluster.py | 8 +++++++-
264a38
 1 file changed, 7 insertions(+), 1 deletion(-)
264a38
264a38
diff --git a/sos/report/plugins/gluster.py b/sos/report/plugins/gluster.py
264a38
index 7b6a9298..e1a89df2 100644
264a38
--- a/sos/report/plugins/gluster.py
264a38
+++ b/sos/report/plugins/gluster.py
264a38
@@ -55,6 +55,9 @@ class Gluster(Plugin, RedHatPlugin):
264a38
 
264a38
     def setup(self):
264a38
         self.add_forbidden_path("/var/lib/glusterd/geo-replication/secret.pem")
264a38
+        self.add_forbidden_path(
264a38
+            "/var/lib/glusterd/glusterfind/glusterfind_*_secret.pem"
264a38
+        )
264a38
 
264a38
         self.add_cmd_output([
264a38
             "gluster peer status",
264a38
@@ -72,7 +75,10 @@ class Gluster(Plugin, RedHatPlugin):
264a38
             "/etc/glusterfs",
264a38
             "/var/lib/glusterd/",
264a38
             # collect nfs-ganesha related configuration
264a38
-            "/run/gluster/shared_storage/nfs-ganesha/"
264a38
+            "/run/gluster/shared_storage/nfs-ganesha/",
264a38
+            # collect status files and public ssh keys
264a38
+            "/var/lib/glusterd/.keys/",
264a38
+            "/var/lib/glusterd/glusterfind/"
264a38
         ] + glob.glob('/run/gluster/*tier-dht/*'))
264a38
 
264a38
         if not self.get_option("all_logs"):
264a38
-- 
264a38
2.26.2
264a38
38f0a6
From 4fb834ec862228afb276ccbd45aa86c66044ea66 Mon Sep 17 00:00:00 2001
38f0a6
From: Pavel Moravec <pmoravec@redhat.com>
38f0a6
Date: Mon, 15 Mar 2021 09:09:51 +0100
38f0a6
Subject: [PATCH] [gluster] collect public keys from the right dir
38f0a6
38f0a6
Collection of glusterfind dir is achieved by /var/lib/gluster
38f0a6
so it doesn't be collected explicitly.
38f0a6
38f0a6
/var/lib/glusterd/glusterfind/.keys/ subdir is required to be
38f0a6
explicitly collected, as add_copy_spec uses glob.glob() that skips
38f0a6
hidden files.
38f0a6
38f0a6
Resolves: #2451
38f0a6
38f0a6
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
38f0a6
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
38f0a6
---
38f0a6
 sos/report/plugins/gluster.py | 5 ++---
38f0a6
 1 file changed, 2 insertions(+), 3 deletions(-)
38f0a6
38f0a6
diff --git a/sos/report/plugins/gluster.py b/sos/report/plugins/gluster.py
38f0a6
index e1a89df2..952cab63 100644
38f0a6
--- a/sos/report/plugins/gluster.py
38f0a6
+++ b/sos/report/plugins/gluster.py
38f0a6
@@ -76,9 +76,8 @@ class Gluster(Plugin, RedHatPlugin):
38f0a6
             "/var/lib/glusterd/",
38f0a6
             # collect nfs-ganesha related configuration
38f0a6
             "/run/gluster/shared_storage/nfs-ganesha/",
38f0a6
-            # collect status files and public ssh keys
38f0a6
-            "/var/lib/glusterd/.keys/",
38f0a6
-            "/var/lib/glusterd/glusterfind/"
38f0a6
+            # collect public ssh keys (a_s_c skips implicit hidden files)
38f0a6
+            "/var/lib/glusterd/glusterfind/.keys/",
38f0a6
         ] + glob.glob('/run/gluster/*tier-dht/*'))
38f0a6
 
38f0a6
         if not self.get_option("all_logs"):
38f0a6
-- 
38f0a6
2.26.2
38f0a6