diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2014-07-06 18:13:43 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:52:31 +0200 |
commit | a427a868d388513da7b5386ba36f1898d7048dd0 (patch) | |
tree | 8c810cd8980d5a3d05e96221ddf607d7f8e190fa /lib/openldap | |
parent | 85e90fece41e0dadb19087a44c4eec8b76c9d5dd (diff) |
Remove useless spaces in LDAP attribute values.
Diffstat (limited to 'lib/openldap')
-rw-r--r-- | lib/openldap | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/openldap b/lib/openldap index 0a8df96..7293b23 100644 --- a/lib/openldap +++ b/lib/openldap @@ -62,6 +62,7 @@ sasl_ext_re = re.compile( r"""(?P<start>\sby\s+dn(?:\.exact)?)= (?P<end>cn=peercred,cn=external,cn=auth) (?P=quote)\s""" , re.VERBOSE ) +multispaces = re.compile( r"\s+" ) pwd_dict = {} def acl_sasl_ext(m): @@ -160,6 +161,11 @@ def flexibleSearch(module, l, dn, entry): # directory with disclose/search/write access. def processEntry(module, l, dn, entry): changed = False + + for x in indexedAttributes.intersection(entry.keys()): + # remove useless extra spaces in ACLs etc + entry[x] = map( partial(multispaces.sub, ' '), entry[x] ) + r = flexibleSearch( module, l, dn, entry ) if r is None: changed = True |