diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2013-04-23 17:41:07 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2013-04-23 17:41:07 +0100 |
commit | b6c4be32b8fa25d1897009c53398fd92f8b6b1ab (patch) | |
tree | 1affdf72c758d4b8e77cf3415bde8e8566aaf245 | |
parent | 8148daf9914ece62a8e5fb62f45d6470661773a7 (diff) | |
parent | ee7f5229a07f1f506b3cf2cc82e1854cec5aba74 (diff) | |
download | sos-b6c4be32b8fa25d1897009c53398fd92f8b6b1ab.tar.gz |
Merge branch 'new_ldap' of https://github.com/karibou/sosreport
Conflicts:
sos/plugins/ldap.py
-rw-r--r-- | sos/plugins/ldap.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/sos/plugins/ldap.py b/sos/plugins/ldap.py index 0c1dc622..b16b7b30 100644 --- a/sos/plugins/ldap.py +++ b/sos/plugins/ldap.py @@ -36,6 +36,10 @@ class Ldap(Plugin): def setup(self): super(Ldap, self).setup() + self.add_copy_spec("/etc/ldap.conf") + + def postproc(self): + self.do_file_sub("/etc/ldap.conf", r"(\s*bindpw\s*)\S+", r"\1***") class RedHatLdap(Ldap, RedHatPlugin): """LDAP related information for RedHat based distribution @@ -45,10 +49,9 @@ class RedHatLdap(Ldap, RedHatPlugin): def setup(self): super(RedHatLdap, self).setup() - self.add_copy_specs(["/etc/ldap.conf", "/etc/openldap", "/etc/nslcd.conf"]) + self.add_copy_specs(["/etc/openldap", "/etc/nslcd.conf"]) def postproc(self): - self.do_file_sub("/etc/ldap.conf", r"(\s*bindpw\s*)\S+", r"\1***") self.do_file_sub("/etc/nslcd.conf", r"(\s*bindpw\s*)\S+", r"\1***") class DebianLdap(Ldap, DebianPlugin, UbuntuPlugin): @@ -61,5 +64,19 @@ class DebianLdap(Ldap, DebianPlugin, UbuntuPlugin): def setup(self): super(DebianLdap, self).setup() - self.add_copy_specs(["/etc/ldap/ldap.conf", "/etc/ldap/slapd.d"]) + ldap_search = "ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// " + self.add_copy_specs(["/etc/ldap/ldap.conf", "/etc/slapd.conf", "/etc/ldap/slapd.d"]) + + self.add_cmd_output("ldapsearch -x -b '' -s base 'objectclass=*'") + self.add_cmd_output(ldap_search + "-b cn=config '(!(objectClass=olcSchemaConfig))'", + suggest_filename="configuration_minus_schemas") + self.add_cmd_output(ldap_search + "-b cn=schema,cn=config dn", + suggest_filename="loaded_schemas") + self.add_cmd_output(ldap_search + "-b cn=config '(olcAccess=*)' olcAccess olcSuffix", + suggest_filename="access_control_lists") + + def postproc(self): + self.do_cmd_output_sub( + "ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config '(!(objectClass=olcSchemaConfig))'", + r"(olcRootPW\: \s*)\S+", r"\1***") |