please review encode_assertion_control()

Rich Megginson rich.megginson at gmail.com
Thu Mar 3 21:59:38 CET 2011


On 03/03/2011 01:28 PM, Michael Ströder wrote:
> HI!
>
> (Sigh!) I'm not a C programmer.
>
> Could somebody please look what's wrong with encode_assertion_control() in
> Modules/ldapcontrol.c? It seg faults.
     err = 
ldap_create_assertion_control_value(NULL,assertion_filterstr,&ctrl_val);
The NULL should be an LDAP* and it must be valid.

It needs the LDAP* handle because it calls ldap_alloc_ber_with_options() 
to allocate the BER for the control value.
> $ python -c "import ldap;print
> repr(ldap.encode_assertion_control('(objectClass=*)'))"
> Segmentation fault (core dumped)
>
> You have to set
>
> extra_compile_args = -g -DLIBLDAP_HAS_ASSERTION_CONTROL_FUNC
>
> in setup.cfg and have a fairly recent OpenLDAP 2.4 installation to get it
> compiled.
>
> Ciao, Michael.
>
> 


More information about the python-ldap mailing list