[python-ldap] [PATCH] fix corrupted search attributes

Michael Ströder michael at stroeder.com
Sun Jan 17 15:12:43 EST 2016


Elmir Jagudin wrote:
> Here is a patch that fixes issue with corrupted search attributes while
> using LDAPObject.search_s().

There's a problem with your patch:
It does not handle attrlist=None correctly.

This script fails with:
TypeError: expected list of strings or None

--------------------- snip ---------------------
import ldap

l = ldap.initialize('ldapi://',trace_level=2)
l.sasl_external_bind_s()

l.search_s(
    'dc=stroeder,dc=de',
    ldap.SCOPE_BASE,
    '(objectClass=*)',
    attrlist=None
)
--------------------- snip ---------------------

Could you please send in a revised patch *soon*?

Note:
I definitely don't want to automagically replace attrlist=None by attrlist=['*']
in the Python wrapper class because some LDAP servers may (incorrectly) treat
these cases differently.

Ciao, Michael.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20160117/773ea7f5/attachment.bin>


More information about the python-ldap mailing list