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

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