aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2023-06-08 18:44:32 -0400
committerJake Hunsaker <jhunsake@redhat.com>2023-06-12 11:12:16 -0400
commit5af51d9f68008983edce0fa0edd07cf7677f136a (patch)
tree5a07432a16be9dceb32654eb94b8f8b565982bd4
parent81ebaa5afab5904f4d6419d63d603096b90ebc3a (diff)
downloadsos-5af51d9f68008983edce0fa0edd07cf7677f136a.tar.gz
[sssd] Handle spaces in postproc regex substitution
Widen the capturing of strings for the `ldap_default_authtok` substitution performed on sssd configuration files to also capture strings with spaces. Closes: #3266 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/sssd.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sos/report/plugins/sssd.py b/sos/report/plugins/sssd.py
index 6f98e90c..b514ec1b 100644
--- a/sos/report/plugins/sssd.py
+++ b/sos/report/plugins/sssd.py
@@ -54,10 +54,10 @@ class Sssd(Plugin):
self.add_cmd_output("sssctl domain-status -o " + domain_name)
def postproc(self):
- regexp = r"(\s*ldap_default_authtok\s*=\s*)\S+"
+ regexp = r"((\s*ldap_default_authtok\s*=)(.*))"
- self.do_file_sub("/etc/sssd/sssd.conf", regexp, r"\1********")
- self.do_path_regex_sub("/etc/sssd/conf.d/*", regexp, r"\1********")
+ self.do_file_sub("/etc/sssd/sssd.conf", regexp, r"\2 ********")
+ self.do_path_regex_sub("/etc/sssd/conf.d/*", regexp, r"\2 ********")
class RedHatSssd(Sssd, RedHatPlugin):