Experiments with pyasn1 and preread control

Andreas Hasenack ahasenack at terra.com.br
Wed Jun 20 22:50:31 CEST 2007

On Wed, Jun 06, 2007 at 02:16:11PM +0200, Michael Ströder wrote:
> Andreas,
> Andreas Hasenack wrote:
> > I have been having fun with controls. Today I tried to use the Pre-Read
> > control together with the modify+increment extension, so that
> > modify+increment becomes actually useful.
> Thanks for sharing your experiences.
> > I first added the encoding part to the ldap.so module, but later got a
> > response from the pyasn1 mailing list and tried again in pure python.
> Saw your postings there. I'm also lurking on the pyasn1-users mailing
> list. The author seems to be quite responsive.
> > The decoding part will probably be more difficult... As the control
> > response is a SearchResultEntry which is a bit more complex to decode.
> How about exposing the function LDAPmessage_to_python() in message.c.
> It's used also to parse search results invoked by l_ldap_result3() in
> LDAPObject.c.

Hmm, the problem is that at that moment of decoding the control I don't
have access to the LDAP* structure anymore, so I can't use
LDAPmessage_to_python(). Or I'm missing something.

All I have is the controlValue, which is an ldap message as returned by
ldap_result which I would usually parse with ldap_first_message(3) and

More information about the python-ldap mailing list