aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Quigley <bryan.quigley@canonical.com>2018-03-12 14:13:11 -0400
committerBryn M. Reeves <bmr@redhat.com>2018-05-18 12:59:08 +0100
commit55b4261eb5a05d761ede8274ff62340290122e30 (patch)
tree9d8b436a6d4d34429210c68a2f08af511d00beec
parent5de122019fe14c6da5f37bad8115814d3e6b7888 (diff)
downloadsos-55b4261eb5a05d761ede8274ff62340290122e30.tar.gz
[ldap] Collect nslcd.conf like RH does
This collects nslcd.conf and also removes the bindpw from it. Resolves: #1247 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/ldap.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/sos/plugins/ldap.py b/sos/plugins/ldap.py
index b9ae6f7c..ef551f01 100644
--- a/sos/plugins/ldap.py
+++ b/sos/plugins/ldap.py
@@ -83,6 +83,7 @@ class DebianLdap(Ldap, DebianPlugin, UbuntuPlugin):
self.ldap_conf,
"/etc/slapd.conf",
"/etc/ldap/slapd.d"
+ "/etc/nslcd.conf",
])
self.add_cmd_output("ldapsearch -x -b '' -s base 'objectclass=*'")
@@ -98,10 +99,16 @@ class DebianLdap(Ldap, DebianPlugin, UbuntuPlugin):
def postproc(self):
super(DebianLdap, self).postproc()
+ self.do_file_sub(
+ "/etc/nslcd.conf",
+ r"(\s*bindpw\s*)\S+",
+ r"\1********"
+ )
self.do_cmd_output_sub(
"ldapsearch",
r"(olcRootPW\: \s*)\S+",
r"\1********"
)
+
# vim: set et ts=4 sw=4 :