[python-ldap] Deref request control appears to not recieve results,

Michael Ströder michael at stroeder.com
Fri Sep 18 13:32:09 CEST 2015


William Brown wrote:
> I am trying to write a dereference control [0] to use for the 389ds project,
> with the intent that once it is working, to include it in python-ldap.

Sorry for following up so late. Did you make any progress in the mean-time? Do
you want to contribute your deref implementation to python-ldap?

> So I can see that the control is processed, the search occurs, and the correct
> result of uid=test is found and dereferenced, and the control is added to the
> server response. 
> 
> However, with trace_level=3, I don't see this result in python ldap:
> 
> *** <lib389.DirSrv instance at 0x7f9625f6d2d8>
> ldap://localhost.localdomain:54321/ - DirSrv.set_option
> ((18,
>   [('1.3.6.1.4.1.4203.666.5.16',
>     True,
>     '0\x1b0\x19\x04\x0cuniqueMember0\t\x04\x03uid\x04\x02dn')]),
>  {})
> => result:
> None
> ...
> *** <lib389.DirSrv instance at 0x7f9625f6d2d8>
> ldap://localhost.localdomain:54321/ - DirSrv.search_ext
> (('dc=example,dc=com', 2, '(cn=testgroup)', None, 0, None, None, -1, 0), {})

Hmm, not sure whether using LDAPObject.set_option() method really works when
using controls.

You should add all the request controls for a search request to list argument
serverctrls when invoking LDAPObject.search_ext()/search_ext_s():

http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.search_ext

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/20150918/9c168527/attachment.bin>


More information about the python-ldap mailing list