[patch] fix get_option() crash, make more OPT_X_SASL_* info available.

Michael Ströder michael at stroeder.com
Mon Sep 25 16:55:46 CEST 2006


Tom,

thanks for contributing.
Sorry for my late reply. My to do list is out of control.

Could you please provide two separate patches I could commit separately?
Could you please check whether python-ldap still builds with OpenLDAP
2.2.x with your patches?

Thanks in advance.

Ciao, Michael.

Tom McLaughlin wrote:
> Hi, the attached patch is to fix a crash I found with py-ldap when using
> get_option() and to allow getting more OPT_X_SASL_* information with
> get_option().
> 
> 1) The second to last hunk fixes a crash when using get_option() and the
> constant returns a NULL.  I can repeat this crash on FreeBSD with python
> 2.4.3 / py-ldap 2.2.0 / openldap 2.3.24 and on CentOS with python 2.3.4 /
> py-ldap 2.0.1 / openldap 2.2.13.
> [..]
> 2) I wanted to be able to get a user's SASL_MECH, SASL_AUTHCID, and
> SASL_AUTHZID but that information wasn't available through py-ldap...  So
> I made it available. :)  Other than adding more SASL constants to
> Modules/options.c, I made LDAP_OPT_X_SASL_SECPROPS return Py_None with
> LDAP_get_option() because according to ldap.h it is read only.  Trying to
> get ldap.OPT_X_SASL_SECPROPS was returning ldap.SERVER_DOWN for me before
> even though I had SASL_SECPROPS defined.
> 
> Please let me know if there are any questions or comments.  I don't
> actually know C...  I just kinda figured out the changes.  Thanks.
> 
> tom



More information about the python-ldap mailing list