Blame SOURCES/sos-bz1940502-sssd-memcache-and-logs.patch

ba407d
From d03c2fa4439c87783293c922b2825cf86e8818bd Mon Sep 17 00:00:00 2001
ba407d
From: =?UTF-8?q?Pawe=C5=82=20Po=C5=82awski?= <ppolawsk@redhat.com>
ba407d
Date: Fri, 12 Mar 2021 12:42:30 +0100
ba407d
Subject: [PATCH] [sssd] Enable collecting SSSD memory cache
ba407d
MIME-Version: 1.0
ba407d
Content-Type: text/plain; charset=UTF-8
ba407d
Content-Transfer-Encoding: 8bit
ba407d
ba407d
SSSD plugin by default collects only logs and configuration.
ba407d
This patch enables collecting memory cache maintained
ba407d
by SSSD daemon. Cache does not contain any client sensible
ba407d
data so can be safely included in the sos-report.
ba407d
ba407d
Resolves: #2444
ba407d
ba407d
Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
ba407d
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
ba407d
---
ba407d
 sos/report/plugins/sssd.py | 8 ++++++--
ba407d
 1 file changed, 6 insertions(+), 2 deletions(-)
ba407d
ba407d
diff --git a/sos/report/plugins/sssd.py b/sos/report/plugins/sssd.py
ba407d
index 9469c41c..aeb68c4f 100644
ba407d
--- a/sos/report/plugins/sssd.py
ba407d
+++ b/sos/report/plugins/sssd.py
ba407d
@@ -10,6 +10,7 @@
ba407d
 
ba407d
 from sos.report.plugins import (Plugin, RedHatPlugin, DebianPlugin,
ba407d
                                 UbuntuPlugin, SoSPredicate)
ba407d
+from glob import glob
ba407d
 
ba407d
 
ba407d
 class Sssd(Plugin):
ba407d
@@ -22,11 +23,22 @@ class Sssd(Plugin):
ba407d
 
ba407d
     def setup(self):
ba407d
         self.add_copy_spec([
ba407d
+            # main config file
ba407d
             "/etc/sssd/sssd.conf",
ba407d
-            "/var/log/sssd/*",
ba407d
-            "/var/lib/sss/pubconf/krb5.include.d/*",
ba407d
             # SSSD 1.14
ba407d
-            "/etc/sssd/conf.d/*.conf"
ba407d
+            "/etc/sssd/conf.d/*.conf",
ba407d
+            # dynamic Kerberos configuration
ba407d
+            "/var/lib/sss/pubconf/krb5.include.d/*"
ba407d
+        ])
ba407d
+
ba407d
+        # add individual log files
ba407d
+        self.add_copy_spec(glob("/var/log/sssd/*log*"))
ba407d
+
ba407d
+        # add memory cache
ba407d
+        self.add_copy_spec([
ba407d
+            "/var/lib/sss/mc/passwd",
ba407d
+            "/var/lib/sss/mc/group",
ba407d
+            "/var/lib/sss/mc/initgroups"
ba407d
         ])
ba407d
 
ba407d
         # call sssctl commands only when sssd service is running,
ba407d
-- 
ba407d
2.26.3
ba407d