[python-ldap] result_type of connection.result()

Dave Peticolas dave at krondo.com
Fri Feb 3 11:48:34 EST 2017


On Thu, Feb 2, 2017 at 8:01 AM Dave Peticolas <dave at krondo.com> wrote:

> On Thu, Feb 2, 2017 at 7:26 AM Michael Ströder <michael at stroeder.com>
> wrote:
>
> Dave Peticolas wrote:
> > Sometimes "kind" will be RES_SEARCH_ENTRY and the results will be
> ignored.
>
> What makes you think you can ignore results with type RES_SEARCH_ENTRY?
>
> Please see: https://tools.ietf.org/html/rfc4511#section-4.5.2
>
>
> I see that, yes. And just to be clear, it's not me that thinks you can
> ignore those results, it's the django-auth-ldap library :) I'm just trying
> to figure out why things are going wrong. But there's also this bit of
> documentation in python-ldap for the result() method:
>
> *For all set to 0, result tuples trickle in (with the same message id),
> and with the result types RES_SEARCH_ENTRY and RES_SEARCH_REFERENCE, until
> the final result which has a result type of RES_SEARCH_RESULT and a
> (usually) empty data field. When all is set to 1, only one result is
> returned, with a result type of RES_SEARCH_RESULT, and all the result
> tuples listed in the data field.*
>
>  Please see:
> https://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.result
>
> To me, that documentation suggests that when all=1 you will only ever see
> a result type of RES_SEARCH_RESULT, but that's not what I am observing.
>

Note the OpenLDAP docs for the underlying C function are a lot less
specific about the result type you can expect when all=1.

https://www.openldap.org/software/man.cgi?query=ldap_result&sektion=3&apropos=0&manpath=OpenLDAP+2.4-Release

Is it possible that the python-ldap docs are simply incorrect here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20170203/10993224/attachment.html>


More information about the python-ldap mailing list