From: Tom M. <tmc...@sd...> - 2006-08-14 20:24:20
|
Hey, I'm retarded... Here's the patch. tom > 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. > > To recreate: (without TLS_CERT defined in ldap.conf || ~/.ldaprc) >>>> ldap.get_option(ldap.OPT_X_TLS_CERTFILE) > > Result: > Segfault > > Backtrace: <snip> > > > 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 > > -- > | tmclaugh at sdf.lonestar.org tmclaugh at FreeBSD.org | > | FreeBSD http://www.FreeBSD.org | > | BSD# http://www.mono-project.com/Mono:FreeBSD | -- | tmclaugh at sdf.lonestar.org tmclaugh at FreeBSD.org | | FreeBSD http://www.FreeBSD.org | | BSD# http://www.mono-project.com/Mono:FreeBSD | |