Updates for OpenLDAP >= 2.0.12

Jacek Konieczny jajcus at bnet.pl
Sat Nov 10 20:07:24 CET 2001


Hi,

current python-ldap won't work with OpenLDAP >= 2.0.21. 

Here is part of CHANGES file from OpenLDAP sources:

OpenLDAP 2.0.12 Release
        ...
        Removed -lldap UFN search support
        ...

python-ldap uses those UFN search functions which are not included in
openldap libraries any more, so it crashes with "unresolved sybol" when
used.

Below is a patch, which removes (in fact makes conditional) support for
UFN search in python-ldap. 
It seems that autoconf support is broken, and I don't know how to check
things like existence of some function with setup.py, so the only way
to activate UFN search again is to '#define UFN_SEARCH'.

I would like to have it commited as soon as possible, so I can work on
TLS support without mixing things :-)

Greets,
        Jacek

Index: setup.cfg
===================================================================
RCS file: /cvsroot/python-ldap/python-ldap/setup.cfg,v
retrieving revision 1.2
diff -u -r1.2 setup.cfg
--- setup.cfg	2001/05/16 02:26:00	1.2
+++ setup.cfg	2001/11/10 18:56:43
@@ -1,6 +1,6 @@
 [_ldap]
 class = OpenLDAP2
-library_dirs = /usr/local/lib
-include_dirs = /usr/local/include
+library_dirs = /usr/lib
+include_dirs = /usr/include
 ; libs = lber ldap
 
Index: Modules/LDAPObject.c
===================================================================

RCS file: /cvsroot/python-ldap/python-ldap/Modules/LDAPObject.c,v
retrieving revision 1.11
diff -u -r1.11 LDAPObject.c
--- Modules/LDAPObject.c	2001/06/06 23:40:04	1.11
+++ Modules/LDAPObject.c	2001/11/10 18:56:57
@@ -1451,6 +1451,7 @@
 
 /* ldap_search_s == ldap_search_st */
 
+#ifdef UFN_SEARCH
 /* ldap_ufn_search_c */
 
 /* ldap_ufn_search_ct */
@@ -1534,6 +1535,7 @@
 "\tSee the LDAP library manual pages for more information on these\n"
 "\t`user-friendly name' functions.";
 
+#endif /* UFN_SEARCH */
 /* ldap_sort_entries */
 
 /* ldap_url_search */
@@ -1688,9 +1690,11 @@
     {"search",		(PyCFunction)l_ldap_search,		METH_VARARGS,	doc_search},	
     {"search_s",	(PyCFunction)l_ldap_search_st,		METH_VARARGS,	doc_search},	
     {"search_st",	(PyCFunction)l_ldap_search_st,		METH_VARARGS,	doc_search},	
+#ifdef UFN_SEARCH
     {"ufn_search_s",	(PyCFunction)l_ldap_ufn_search_s,	METH_VARARGS,	doc_ufn},
     {"ufn_setfilter",	(PyCFunction)l_ldap_ufn_setfilter,	METH_VARARGS,	doc_ufn},
     {"ufn_setprefix",	(PyCFunction)l_ldap_ufn_setprefix,	METH_VARARGS,	doc_ufn},
+#endif /* UFN_SEARCH */
     {"url_search_s",	(PyCFunction)l_ldap_url_search_st,	METH_VARARGS,	doc_url_search},	
     {"url_search_st",	(PyCFunction)l_ldap_url_search_st,	METH_VARARGS,	doc_url_search},	
 #if defined(FILENO_SUPPORTED)





More information about the python-ldap mailing list