ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

Michael Ströder michael at stroeder.com
Mon Mar 16 13:48:35 CET 2009


Michael Ströder wrote:
> Zhang Huangbin wrote:
>> Michael Ströder wrote:
>>> To all of the people experiencing problems:
>>> Could you please run Demo/page_control.py after applying the attached
>>> patch (which enables debug logging).
>> Here is output msg:
> 
> So this seems to boil down to that the following commands (lines
> wrapped) would fail at your site instead of returning the encoded
> control tuple:
> 
>>>> import ldap
>>>> from ldap.controls import SimplePagedResultsControl
>>>>
> SimplePagedResultsControl(ldap.LDAP_CONTROL_PAGE_OID,True,(10,'')).getEncodedTuple()
> ('1.2.840.113556.1.4.319', True, '0\x05\x02\x01\n\x04\x00')

Could somebody with more knowledge of C programming please review
function encode_rfc2696() in Modules/ldapcontrol.c?

The following var declaration could be problematic on 64-bit systems:

    unsigned long size;

Another issue could be in decode_rfc2696() (which is not yet reached if
encode_rfc2696() fails):

    unsigned long count;

Ciao, Michael.



More information about the python-ldap mailing list