aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2001-06-10 15:12:30 +0800
committerdinoex <dinoex@FreeBSD.org>2001-06-10 15:12:30 +0800
commita25914bdc81176c6e060597f1b0d6bf3e0f4cd60 (patch)
tree19b4cdcbd246c0f5ed65178d65b20f759cabe342 /net
parent396519e56bb44065a7528d690a94bfc57bab4de0 (diff)
downloadfreebsd-ports-gnome-a25914bdc81176c6e060597f1b0d6bf3e0f4cd60.tar.gz
freebsd-ports-gnome-a25914bdc81176c6e060597f1b0d6bf3e0f4cd60.tar.zst
freebsd-ports-gnome-a25914bdc81176c6e060597f1b0d6bf3e0f4cd60.zip
Patched net/ldapmodule to adapt openldap2.
(source patches are from Joe Little's SRPM) It builds against both of openldap1 openldap2 Submitted by: perky@python.or.kr
Diffstat (limited to 'net')
-rw-r--r--net/ldapmodule/Makefile4
-rw-r--r--net/ldapmodule/files/patch-Makefile.in11
-rw-r--r--net/ldapmodule/files/patch-constants.c156
-rw-r--r--net/ldapmodule/files/patch-errors.c115
-rw-r--r--net/ldapmodule/files/patch-message.c43
-rw-r--r--net/ldapmodule/pkg-plist1
-rw-r--r--net/py-ldap1/Makefile4
-rw-r--r--net/py-ldap1/files/patch-Makefile.in11
-rw-r--r--net/py-ldap1/files/patch-constants.c156
-rw-r--r--net/py-ldap1/files/patch-errors.c115
-rw-r--r--net/py-ldap1/files/patch-message.c43
-rw-r--r--net/py-ldap1/pkg-plist1
-rw-r--r--net/py-ldap2/Makefile4
-rw-r--r--net/py-ldap2/files/patch-Makefile.in11
-rw-r--r--net/py-ldap2/files/patch-constants.c156
-rw-r--r--net/py-ldap2/files/patch-errors.c115
-rw-r--r--net/py-ldap2/files/patch-message.c43
-rw-r--r--net/py-ldap2/pkg-plist1
18 files changed, 981 insertions, 9 deletions
diff --git a/net/ldapmodule/Makefile b/net/ldapmodule/Makefile
index 06491c2296a4..e1f6b4095e78 100644
--- a/net/ldapmodule/Makefile
+++ b/net/ldapmodule/Makefile
@@ -6,14 +6,14 @@
PORTNAME= ldapmodule
PORTVERSION= 1.10alpha3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net
MASTER_SITES= ftp://python-ldap.sourceforge.net/pub/python-ldap/
DISTNAME= python-ldap-${PORTVERSION}-src
MAINTAINER= dirk.meyer@dinoex.sub.org
-LIB_DEPENDS= ldap.1:${PORTSDIR}/net/openldap
+LIB_DEPENDS= ldap:${PORTSDIR}/net/openldap2
BUILD_DEPENDS= python:${PORTSDIR}/lang/python
RUN_DEPENDS= python:${PORTSDIR}/lang/python
diff --git a/net/ldapmodule/files/patch-Makefile.in b/net/ldapmodule/files/patch-Makefile.in
new file mode 100644
index 000000000000..17e51a4a0584
--- /dev/null
+++ b/net/ldapmodule/files/patch-Makefile.in
@@ -0,0 +1,11 @@
+--- Makefile.in.orig Wed May 23 09:11:33 2001
++++ Makefile.in Wed May 23 09:12:10 2001
+@@ -26,6 +26,8 @@
+ $(INSTALL_DIR) $(DESTDIR)$(LIBDEST)/site-packages/python-ldap
+ $(INSTALL_DATA) $(srcdir)/Misc/ldap.pth \
+ $(DESTDIR)$(LIBDEST)/site-packages/ldap.pth
++ $(INSTALL_DATA) $(srcdir)/Modules/_ldapmodule.so \
++ $(DESTDIR)$(LIBDEST)/site-packages/_ldapmodule.so
+ for f in $(srcdir)/Lib/*.py; do \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(LIBDEST)/site-packages/python-ldap/;\
+ done
diff --git a/net/ldapmodule/files/patch-constants.c b/net/ldapmodule/files/patch-constants.c
new file mode 100644
index 000000000000..65b496acb045
--- /dev/null
+++ b/net/ldapmodule/files/patch-constants.c
@@ -0,0 +1,156 @@
+--- Modules/constants.c.orig Sun Aug 13 16:00:59 2000
++++ Modules/constants.c Mon Nov 6 11:02:43 2000
+@@ -66,7 +66,6 @@
+ add_int(d,VERSION1);
+ add_int(d,VERSION2);
+ add_int(d,VERSION);
+- add_int(d,MAX_ATTR_LEN);
+ add_int(d,TAG_MESSAGE);
+ add_int(d,TAG_MSGID);
+
+@@ -79,9 +78,27 @@
+ add_int(d,REQ_MODRDN);
+ add_int(d,REQ_COMPARE);
+ add_int(d,REQ_ABANDON);
++
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int(d,VERSION3);
++ add_int(d,VERSION_MIN);
++ add_int(d,VERSION_MAX);
++ add_int(d,TAG_LDAPDN);
++ add_int(d,TAG_LDAPCRED);
++ add_int(d,TAG_CONTROLS);
++ add_int(d,TAG_REFERRAL);
++
++ add_int(d,REQ_MODDN);
++ add_int(d,REQ_RENAME);
++#else
++ /* OpenLDAPv1 */
++ add_int(d,MAX_ATTR_LEN);
++
+ add_int(d,REQ_UNBIND_30);
+ add_int(d,REQ_DELETE_30);
+ add_int(d,REQ_ABANDON_30);
++#endif
+
+ /* reversibles */
+
+@@ -89,6 +106,14 @@
+ PyDict_SetItem( reverse, zero, Py_None );
+ Py_DECREF( zero );
+
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int_r(d,RES_SEARCH_REFERENCE);
++ add_int_r(d,RES_MODDN); /* Aliases for RES_MODRDN; */
++ add_int_r(d,RES_RENAME); /* init them before the main name */
++ add_int(d,RES_UNSOLICITED);
++#endif
++
+ add_int_r(d,RES_BIND);
+ add_int_r(d,RES_SEARCH_ENTRY);
+ add_int_r(d,RES_SEARCH_RESULT);
+@@ -106,9 +131,6 @@
+ add_int(d,AUTH_KRBV4);
+ add_int(d,AUTH_KRBV41);
+ add_int(d,AUTH_KRBV42);
+- add_int(d,AUTH_SIMPLE_30);
+- add_int(d,AUTH_KRBV41_30);
+- add_int(d,AUTH_KRBV42_30);
+ add_int(d,FILTER_AND);
+ add_int(d,FILTER_OR);
+ add_int(d,FILTER_NOT);
+@@ -118,13 +140,9 @@
+ add_int(d,FILTER_LE);
+ add_int(d,FILTER_PRESENT);
+ add_int(d,FILTER_APPROX);
+- add_int(d,FILTER_PRESENT_30);
+ add_int(d,SUBSTRING_INITIAL);
+ add_int(d,SUBSTRING_ANY);
+ add_int(d,SUBSTRING_FINAL);
+- add_int(d,SUBSTRING_INITIAL_30);
+- add_int(d,SUBSTRING_ANY_30);
+- add_int(d,SUBSTRING_FINAL_30);
+ add_int(d,SCOPE_BASE);
+ add_int(d,SCOPE_ONELEVEL);
+ add_int(d,SCOPE_SUBTREE);
+@@ -133,6 +151,16 @@
+ add_int(d,MOD_REPLACE);
+ add_int(d,MOD_BVALUES);
+
++#if !defined(LDAP_API_VERSION)
++ /* OpenLDAPv1 */
++ add_int(d,AUTH_SIMPLE_30);
++ add_int(d,AUTH_KRBV41_30);
++ add_int(d,AUTH_KRBV42_30);
++ add_int(d,FILTER_PRESENT_30);
++ add_int(d,SUBSTRING_INITIAL_30);
++ add_int(d,SUBSTRING_ANY_30);
++ add_int(d,SUBSTRING_FINAL_30);
++
+ /* (errors.c contains the error constants) */
+
+ add_int(d,DEFAULT_REFHOPLIMIT);
+@@ -145,15 +173,36 @@
+ #ifdef LDAP_CACHE_OPT_CACHEALLERRS
+ add_int(d,CACHE_OPT_CACHEALLERRS);
+ #endif
++
++#endif /* !defined(LDAP_API_VERSION) */
+ add_int(d,FILT_MAXSIZ);
+ add_int(d,DEREF_NEVER);
+ add_int(d,DEREF_SEARCHING);
+ add_int(d,DEREF_FINDING);
+ add_int(d,DEREF_ALWAYS);
+ add_int(d,NO_LIMIT);
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int(d,OPT_API_INFO);
++ add_int(d,OPT_DESC);
++ add_int(d,OPT_DEREF);
++ add_int(d,OPT_SIZELIMIT);
++ add_int(d,OPT_TIMELIMIT);
++ add_int(d,OPT_PROTOCOL_VERSION);
++ add_int(d,OPT_SERVER_CONTROLS);
++ add_int(d,OPT_CLIENT_CONTROLS);
++ add_int(d,OPT_API_FEATURE_INFO);
++ add_int(d,OPT_HOST_NAME);
++ add_int(d,OPT_ERROR_NUMBER);
++ add_int(d,OPT_ERROR_STRING);
++ add_int(d,OPT_MATCHED_DN);
++ add_int(d,OPT_PRIVATE_EXTENSION_BASE);
++#else
++ /* OpenLDAPv1 */
+ #ifdef LDAP_OPT_DNS
+ add_int(d,OPT_DNS);
+ #endif
++#endif /* defined(LDAP_API_VERSION) */
+ #ifdef LDAP_OPT_REFERRALS
+ add_int(d,OPT_REFERRALS);
+ #endif
+@@ -161,9 +210,24 @@
+
+ /* XXX - these belong in errors.c */
+
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int(d,URL_SUCCESS);
++ add_int(d,URL_ERR_PARAM);
++ add_int(d,URL_ERR_BADSCHEME);
++ add_int(d,URL_ERR_BADENCLOSURE);
++ add_int(d,URL_ERR_BADURL);
++ add_int(d,URL_ERR_BADHOST);
++ add_int(d,URL_ERR_BADATTRS);
++ add_int(d,URL_ERR_BADSCOPE);
++ add_int(d,URL_ERR_BADFILTER);
++ add_int(d,URL_ERR_BADEXTS);
++#else
++ /* OpenLDAPv1 */
+ add_int(d,URL_ERR_NOTLDAP);
+ add_int(d,URL_ERR_NODN);
+ add_int(d,URL_ERR_BADSCOPE);
++#endif /* defined(LDAP_API_VERSION) */
+ add_int(d,URL_ERR_MEM);
+
+ /* author */
diff --git a/net/ldapmodule/files/patch-errors.c b/net/ldapmodule/files/patch-errors.c
new file mode 100644
index 000000000000..86d6baa60aba
--- /dev/null
+++ b/net/ldapmodule/files/patch-errors.c
@@ -0,0 +1,115 @@
+--- Modules/errors.c.orig Wed Nov 15 10:41:35 2000
++++ Modules/errors.c Wed Nov 15 14:17:15 2000
+@@ -17,7 +17,13 @@
+
+ /* list of error objects */
+
++#if defined(LDAP_API_VERSION)
++/* OpenLDAPv2 */
++#define NUM_LDAP_ERRORS LDAP_REFERRAL_LIMIT_EXCEEDED+1
++#else
++/* OpenLDAPv1 */
+ #define NUM_LDAP_ERRORS LDAP_NO_MEMORY+1
++#endif
+ static PyObject*
+ errobjects[ NUM_LDAP_ERRORS ];
+
+@@ -30,21 +36,26 @@
+ PyErr_SetFromErrno( LDAPexception_class );
+ return NULL;
+ }
+-#ifdef LDAP_TYPE_IS_OPAQUE
++#if defined(LDAP_TYPE_IS_OPAQUE) && !defined(LDAP_API_VERSION)
+ else {
+ PyErr_SetString(LDAPexception_class,
+ "unknown error (C API does not expose error)");
+ return NULL;
+ }
+-#else
++#else /* defined(LDAP_TYPE_IS_OPAQUE) && !defined(LDAP_API_VERSION) */
+ else {
+ int errnum;
+ PyObject *errobj;
+ PyObject *info;
+ PyObject *str;
+
++#if defined(LDAP_API_VERSION)
++ char *matched, *error;
++ if (ldap_get_option(l, LDAP_OPT_ERROR_NUMBER, &errnum) < 0)
++#else
+ errnum = l->ld_errno;
+ if (errnum<0 || errnum>=NUM_LDAP_ERRORS)
++#endif /* defined(LDAP_API_VERSION) */
+ errobj = LDAPexception_class; /* unknown error XXX */
+ else
+ errobj = errobjects[errnum];
+@@ -61,6 +72,35 @@
+ PyDict_SetItemString( info, "desc", str );
+ Py_XDECREF(str);
+
++#if defined(LDAP_API_VERSION)
++ if (ldap_get_option(l, LDAP_OPT_MATCHED_DN, &matched) >= 0
++ && matched != NULL) {
++ if (*matched != '\0') {
++ str = PyString_FromString(matched);
++ if (str)
++ PyDict_SetItemString( info, "matched", str );
++ Py_XDECREF(str);
++ }
++ ldap_memfree(matched);
++ }
++
++ if (errnum == LDAP_REFERRAL) {
++ str = PyString_FromString(msg);
++ if (str)
++ PyDict_SetItemString( info, "info", str );
++ Py_XDECREF(str);
++ } else if (ldap_get_option(l, LDAP_OPT_ERROR_STRING, &error) >= 0
++ && error != NULL) {
++ if (error != '\0') {
++ str = PyString_FromString(error);
++ if (str)
++ PyDict_SetItemString( info, "info", str );
++ Py_XDECREF(str);
++ }
++ ldap_memfree(error);
++ }
++
++#else /* defined(LDAP_API_VERSION) */
+ if (l->ld_matched != NULL && *l->ld_matched != '\0')
+ {
+ str = PyString_FromString(l->ld_matched);
+@@ -76,11 +116,12 @@
+ PyDict_SetItemString( info, "info", str );
+ Py_XDECREF(str);
+ }
++#endif /* defined(LDAP_API_VERSION) */
+ PyErr_SetObject( errobj, info );
+ Py_DECREF(info);
+ return NULL;
+ }
+-#endif
++#endif /* defined(LDAP_TYPE_IS_OPAQUE) && !defined(LDAP_API_VERSION) */
+ }
+
+
+@@ -163,4 +204,19 @@
+ seterrobj(USER_CANCELLED);
+ seterrobj(PARAM_ERROR);
+ seterrobj(NO_MEMORY);
++#if defined(LDAP_API_VERSION)
++ seterrobj(REFERRAL);
++ seterrobj(ADMINLIMIT_EXCEEDED);
++ seterrobj(UNAVAILABLE_CRITICAL_EXTENSION);
++ seterrobj(CONFIDENTIALITY_REQUIRED);
++ seterrobj(SASL_BIND_IN_PROGRESS);
++ seterrobj(AFFECTS_MULTIPLE_DSAS);
++ seterrobj(CONNECT_ERROR);
++ seterrobj(NOT_SUPPORTED);
++ seterrobj(CONTROL_NOT_FOUND);
++ seterrobj(NO_RESULTS_RETURNED);
++ seterrobj(MORE_RESULTS_TO_RETURN);
++ seterrobj(CLIENT_LOOP);
++ seterrobj(REFERRAL_LIMIT_EXCEEDED);
++#endif
+ }
diff --git a/net/ldapmodule/files/patch-message.c b/net/ldapmodule/files/patch-message.c
new file mode 100644
index 000000000000..1b7111a84ae2
--- /dev/null
+++ b/net/ldapmodule/files/patch-message.c
@@ -0,0 +1,43 @@
+--- Modules/message.c.orig Wed Nov 15 10:41:35 2000
++++ Modules/message.c Wed Nov 15 16:51:18 2000
+@@ -114,6 +114,40 @@
+ PyList_Append(result, entrytuple);
+ Py_DECREF(entrytuple);
+ }
++#if defined(LDAP_API_VERSION)
++ for(entry = ldap_first_reference(ld,m);
++ entry != NULL;
++ entry = ldap_next_reference(ld,entry))
++ {
++ char **refs = NULL;
++ PyObject* entrytuple;
++ PyObject* reflist = PyList_New(0);
++
++ if (reflist == NULL) {
++ Py_DECREF(result);
++ ldap_msgfree( m );
++ return NULL;
++ }
++ if (ldap_parse_reference(ld, entry, &refs, NULL, 0) != LDAP_SUCCESS) {
++ Py_DECREF(result);
++ ldap_msgfree( m );
++ return LDAPerror( ld, "ldap_parse_reference" );
++ }
++ if (refs) {
++ int i;
++ for (i=0; refs[i] != NULL; i++) {
++ PyObject *refstr = PyString_FromString(refs[i]);
++ PyList_Append(reflist, refstr);
++ Py_DECREF(refstr);
++ }
++ ber_memvfree( (void **) refs );
++ }
++ entrytuple = Py_BuildValue("(sO)", NULL, reflist);
++ Py_DECREF(reflist);
++ PyList_Append(result, entrytuple);
++ Py_DECREF(entrytuple);
++ }
++#endif
+ ldap_msgfree( m );
+ return result;
+ }
diff --git a/net/ldapmodule/pkg-plist b/net/ldapmodule/pkg-plist
index 757f576fbcd9..a9457c11bd86 100644
--- a/net/ldapmodule/pkg-plist
+++ b/net/ldapmodule/pkg-plist
@@ -10,4 +10,3 @@ lib/%%PYTHON_VERSION%%/site-packages/python-ldap/perldap.pyo
lib/%%PYTHON_VERSION%%/site-packages/_ldapmodule.so
lib/%%PYTHON_VERSION%%/site-packages/ldap.pth
@dirrm lib/%%PYTHON_VERSION%%/site-packages/python-ldap
-@dirrm lib/%%PYTHON_VERSION%%/site-packages
diff --git a/net/py-ldap1/Makefile b/net/py-ldap1/Makefile
index 06491c2296a4..e1f6b4095e78 100644
--- a/net/py-ldap1/Makefile
+++ b/net/py-ldap1/Makefile
@@ -6,14 +6,14 @@
PORTNAME= ldapmodule
PORTVERSION= 1.10alpha3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net
MASTER_SITES= ftp://python-ldap.sourceforge.net/pub/python-ldap/
DISTNAME= python-ldap-${PORTVERSION}-src
MAINTAINER= dirk.meyer@dinoex.sub.org
-LIB_DEPENDS= ldap.1:${PORTSDIR}/net/openldap
+LIB_DEPENDS= ldap:${PORTSDIR}/net/openldap2
BUILD_DEPENDS= python:${PORTSDIR}/lang/python
RUN_DEPENDS= python:${PORTSDIR}/lang/python
diff --git a/net/py-ldap1/files/patch-Makefile.in b/net/py-ldap1/files/patch-Makefile.in
new file mode 100644
index 000000000000..17e51a4a0584
--- /dev/null
+++ b/net/py-ldap1/files/patch-Makefile.in
@@ -0,0 +1,11 @@
+--- Makefile.in.orig Wed May 23 09:11:33 2001
++++ Makefile.in Wed May 23 09:12:10 2001
+@@ -26,6 +26,8 @@
+ $(INSTALL_DIR) $(DESTDIR)$(LIBDEST)/site-packages/python-ldap
+ $(INSTALL_DATA) $(srcdir)/Misc/ldap.pth \
+ $(DESTDIR)$(LIBDEST)/site-packages/ldap.pth
++ $(INSTALL_DATA) $(srcdir)/Modules/_ldapmodule.so \
++ $(DESTDIR)$(LIBDEST)/site-packages/_ldapmodule.so
+ for f in $(srcdir)/Lib/*.py; do \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(LIBDEST)/site-packages/python-ldap/;\
+ done
diff --git a/net/py-ldap1/files/patch-constants.c b/net/py-ldap1/files/patch-constants.c
new file mode 100644
index 000000000000..65b496acb045
--- /dev/null
+++ b/net/py-ldap1/files/patch-constants.c
@@ -0,0 +1,156 @@
+--- Modules/constants.c.orig Sun Aug 13 16:00:59 2000
++++ Modules/constants.c Mon Nov 6 11:02:43 2000
+@@ -66,7 +66,6 @@
+ add_int(d,VERSION1);
+ add_int(d,VERSION2);
+ add_int(d,VERSION);
+- add_int(d,MAX_ATTR_LEN);
+ add_int(d,TAG_MESSAGE);
+ add_int(d,TAG_MSGID);
+
+@@ -79,9 +78,27 @@
+ add_int(d,REQ_MODRDN);
+ add_int(d,REQ_COMPARE);
+ add_int(d,REQ_ABANDON);
++
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int(d,VERSION3);
++ add_int(d,VERSION_MIN);
++ add_int(d,VERSION_MAX);
++ add_int(d,TAG_LDAPDN);
++ add_int(d,TAG_LDAPCRED);
++ add_int(d,TAG_CONTROLS);
++ add_int(d,TAG_REFERRAL);
++
++ add_int(d,REQ_MODDN);
++ add_int(d,REQ_RENAME);
++#else
++ /* OpenLDAPv1 */
++ add_int(d,MAX_ATTR_LEN);
++
+ add_int(d,REQ_UNBIND_30);
+ add_int(d,REQ_DELETE_30);
+ add_int(d,REQ_ABANDON_30);
++#endif
+
+ /* reversibles */
+
+@@ -89,6 +106,14 @@
+ PyDict_SetItem( reverse, zero, Py_None );
+ Py_DECREF( zero );
+
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int_r(d,RES_SEARCH_REFERENCE);
++ add_int_r(d,RES_MODDN); /* Aliases for RES_MODRDN; */
++ add_int_r(d,RES_RENAME); /* init them before the main name */
++ add_int(d,RES_UNSOLICITED);
++#endif
++
+ add_int_r(d,RES_BIND);
+ add_int_r(d,RES_SEARCH_ENTRY);
+ add_int_r(d,RES_SEARCH_RESULT);
+@@ -106,9 +131,6 @@
+ add_int(d,AUTH_KRBV4);
+ add_int(d,AUTH_KRBV41);
+ add_int(d,AUTH_KRBV42);
+- add_int(d,AUTH_SIMPLE_30);
+- add_int(d,AUTH_KRBV41_30);
+- add_int(d,AUTH_KRBV42_30);
+ add_int(d,FILTER_AND);
+ add_int(d,FILTER_OR);
+ add_int(d,FILTER_NOT);
+@@ -118,13 +140,9 @@
+ add_int(d,FILTER_LE);
+ add_int(d,FILTER_PRESENT);
+ add_int(d,FILTER_APPROX);
+- add_int(d,FILTER_PRESENT_30);
+ add_int(d,SUBSTRING_INITIAL);
+ add_int(d,SUBSTRING_ANY);
+ add_int(d,SUBSTRING_FINAL);
+- add_int(d,SUBSTRING_INITIAL_30);
+- add_int(d,SUBSTRING_ANY_30);
+- add_int(d,SUBSTRING_FINAL_30);
+ add_int(d,SCOPE_BASE);
+ add_int(d,SCOPE_ONELEVEL);
+ add_int(d,SCOPE_SUBTREE);
+@@ -133,6 +151,16 @@
+ add_int(d,MOD_REPLACE);
+ add_int(d,MOD_BVALUES);
+
++#if !defined(LDAP_API_VERSION)
++ /* OpenLDAPv1 */
++ add_int(d,AUTH_SIMPLE_30);
++ add_int(d,AUTH_KRBV41_30);
++ add_int(d,AUTH_KRBV42_30);
++ add_int(d,FILTER_PRESENT_30);
++ add_int(d,SUBSTRING_INITIAL_30);
++ add_int(d,SUBSTRING_ANY_30);
++ add_int(d,SUBSTRING_FINAL_30);
++
+ /* (errors.c contains the error constants) */
+
+ add_int(d,DEFAULT_REFHOPLIMIT);
+@@ -145,15 +173,36 @@
+ #ifdef LDAP_CACHE_OPT_CACHEALLERRS
+ add_int(d,CACHE_OPT_CACHEALLERRS);
+ #endif
++
++#endif /* !defined(LDAP_API_VERSION) */
+ add_int(d,FILT_MAXSIZ);
+ add_int(d,DEREF_NEVER);
+ add_int(d,DEREF_SEARCHING);
+ add_int(d,DEREF_FINDING);
+ add_int(d,DEREF_ALWAYS);
+ add_int(d,NO_LIMIT);
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int(d,OPT_API_INFO);
++ add_int(d,OPT_DESC);
++ add_int(d,OPT_DEREF);
++ add_int(d,OPT_SIZELIMIT);
++ add_int(d,OPT_TIMELIMIT);
++ add_int(d,OPT_PROTOCOL_VERSION);
++ add_int(d,OPT_SERVER_CONTROLS);
++ add_int(d,OPT_CLIENT_CONTROLS);
++ add_int(d,OPT_API_FEATURE_INFO);
++ add_int(d,OPT_HOST_NAME);
++ add_int(d,OPT_ERROR_NUMBER);
++ add_int(d,OPT_ERROR_STRING);
++ add_int(d,OPT_MATCHED_DN);
++ add_int(d,OPT_PRIVATE_EXTENSION_BASE);
++#else
++ /* OpenLDAPv1 */
+ #ifdef LDAP_OPT_DNS
+ add_int(d,OPT_DNS);
+ #endif
++#endif /* defined(LDAP_API_VERSION) */
+ #ifdef LDAP_OPT_REFERRALS
+ add_int(d,OPT_REFERRALS);
+ #endif
+@@ -161,9 +210,24 @@
+
+ /* XXX - these belong in errors.c */
+
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int(d,URL_SUCCESS);
++ add_int(d,URL_ERR_PARAM);
++ add_int(d,URL_ERR_BADSCHEME);
++ add_int(d,URL_ERR_BADENCLOSURE);
++ add_int(d,URL_ERR_BADURL);
++ add_int(d,URL_ERR_BADHOST);
++ add_int(d,URL_ERR_BADATTRS);
++ add_int(d,URL_ERR_BADSCOPE);
++ add_int(d,URL_ERR_BADFILTER);
++ add_int(d,URL_ERR_BADEXTS);
++#else
++ /* OpenLDAPv1 */
+ add_int(d,URL_ERR_NOTLDAP);
+ add_int(d,URL_ERR_NODN);
+ add_int(d,URL_ERR_BADSCOPE);
++#endif /* defined(LDAP_API_VERSION) */
+ add_int(d,URL_ERR_MEM);
+
+ /* author */
diff --git a/net/py-ldap1/files/patch-errors.c b/net/py-ldap1/files/patch-errors.c
new file mode 100644
index 000000000000..86d6baa60aba
--- /dev/null
+++ b/net/py-ldap1/files/patch-errors.c
@@ -0,0 +1,115 @@
+--- Modules/errors.c.orig Wed Nov 15 10:41:35 2000
++++ Modules/errors.c Wed Nov 15 14:17:15 2000
+@@ -17,7 +17,13 @@
+
+ /* list of error objects */
+
++#if defined(LDAP_API_VERSION)
++/* OpenLDAPv2 */
++#define NUM_LDAP_ERRORS LDAP_REFERRAL_LIMIT_EXCEEDED+1
++#else
++/* OpenLDAPv1 */
+ #define NUM_LDAP_ERRORS LDAP_NO_MEMORY+1
++#endif
+ static PyObject*
+ errobjects[ NUM_LDAP_ERRORS ];
+
+@@ -30,21 +36,26 @@
+ PyErr_SetFromErrno( LDAPexception_class );
+ return NULL;
+ }
+-#ifdef LDAP_TYPE_IS_OPAQUE
++#if defined(LDAP_TYPE_IS_OPAQUE) && !defined(LDAP_API_VERSION)
+ else {
+ PyErr_SetString(LDAPexception_class,
+ "unknown error (C API does not expose error)");
+ return NULL;
+ }
+-#else
++#else /* defined(LDAP_TYPE_IS_OPAQUE) && !defined(LDAP_API_VERSION) */
+ else {
+ int errnum;
+ PyObject *errobj;
+ PyObject *info;
+ PyObject *str;
+
++#if defined(LDAP_API_VERSION)
++ char *matched, *error;
++ if (ldap_get_option(l, LDAP_OPT_ERROR_NUMBER, &errnum) < 0)
++#else
+ errnum = l->ld_errno;
+ if (errnum<0 || errnum>=NUM_LDAP_ERRORS)
++#endif /* defined(LDAP_API_VERSION) */
+ errobj = LDAPexception_class; /* unknown error XXX */
+ else
+ errobj = errobjects[errnum];
+@@ -61,6 +72,35 @@
+ PyDict_SetItemString( info, "desc", str );
+ Py_XDECREF(str);
+
++#if defined(LDAP_API_VERSION)
++ if (ldap_get_option(l, LDAP_OPT_MATCHED_DN, &matched) >= 0
++ && matched != NULL) {
++ if (*matched != '\0') {
++ str = PyString_FromString(matched);
++ if (str)
++ PyDict_SetItemString( info, "matched", str );
++ Py_XDECREF(str);
++ }
++ ldap_memfree(matched);
++ }
++
++ if (errnum == LDAP_REFERRAL) {
++ str = PyString_FromString(msg);
++ if (str)
++ PyDict_SetItemString( info, "info", str );
++ Py_XDECREF(str);
++ } else if (ldap_get_option(l, LDAP_OPT_ERROR_STRING, &error) >= 0
++ && error != NULL) {
++ if (error != '\0') {
++ str = PyString_FromString(error);
++ if (str)
++ PyDict_SetItemString( info, "info", str );
++ Py_XDECREF(str);
++ }
++ ldap_memfree(error);
++ }
++
++#else /* defined(LDAP_API_VERSION) */
+ if (l->ld_matched != NULL && *l->ld_matched != '\0')
+ {
+ str = PyString_FromString(l->ld_matched);
+@@ -76,11 +116,12 @@
+ PyDict_SetItemString( info, "info", str );
+ Py_XDECREF(str);
+ }
++#endif /* defined(LDAP_API_VERSION) */
+ PyErr_SetObject( errobj, info );
+ Py_DECREF(info);
+ return NULL;
+ }
+-#endif
++#endif /* defined(LDAP_TYPE_IS_OPAQUE) && !defined(LDAP_API_VERSION) */
+ }
+
+
+@@ -163,4 +204,19 @@
+ seterrobj(USER_CANCELLED);
+ seterrobj(PARAM_ERROR);
+ seterrobj(NO_MEMORY);
++#if defined(LDAP_API_VERSION)
++ seterrobj(REFERRAL);
++ seterrobj(ADMINLIMIT_EXCEEDED);
++ seterrobj(UNAVAILABLE_CRITICAL_EXTENSION);
++ seterrobj(CONFIDENTIALITY_REQUIRED);
++ seterrobj(SASL_BIND_IN_PROGRESS);
++ seterrobj(AFFECTS_MULTIPLE_DSAS);
++ seterrobj(CONNECT_ERROR);
++ seterrobj(NOT_SUPPORTED);
++ seterrobj(CONTROL_NOT_FOUND);
++ seterrobj(NO_RESULTS_RETURNED);
++ seterrobj(MORE_RESULTS_TO_RETURN);
++ seterrobj(CLIENT_LOOP);
++ seterrobj(REFERRAL_LIMIT_EXCEEDED);
++#endif
+ }
diff --git a/net/py-ldap1/files/patch-message.c b/net/py-ldap1/files/patch-message.c
new file mode 100644
index 000000000000..1b7111a84ae2
--- /dev/null
+++ b/net/py-ldap1/files/patch-message.c
@@ -0,0 +1,43 @@
+--- Modules/message.c.orig Wed Nov 15 10:41:35 2000
++++ Modules/message.c Wed Nov 15 16:51:18 2000
+@@ -114,6 +114,40 @@
+ PyList_Append(result, entrytuple);
+ Py_DECREF(entrytuple);
+ }
++#if defined(LDAP_API_VERSION)
++ for(entry = ldap_first_reference(ld,m);
++ entry != NULL;
++ entry = ldap_next_reference(ld,entry))
++ {
++ char **refs = NULL;
++ PyObject* entrytuple;
++ PyObject* reflist = PyList_New(0);
++
++ if (reflist == NULL) {
++ Py_DECREF(result);
++ ldap_msgfree( m );
++ return NULL;
++ }
++ if (ldap_parse_reference(ld, entry, &refs, NULL, 0) != LDAP_SUCCESS) {
++ Py_DECREF(result);
++ ldap_msgfree( m );
++ return LDAPerror( ld, "ldap_parse_reference" );
++ }
++ if (refs) {
++ int i;
++ for (i=0; refs[i] != NULL; i++) {
++ PyObject *refstr = PyString_FromString(refs[i]);
++ PyList_Append(reflist, refstr);
++ Py_DECREF(refstr);
++ }
++ ber_memvfree( (void **) refs );
++ }
++ entrytuple = Py_BuildValue("(sO)", NULL, reflist);
++ Py_DECREF(reflist);
++ PyList_Append(result, entrytuple);
++ Py_DECREF(entrytuple);
++ }
++#endif
+ ldap_msgfree( m );
+ return result;
+ }
diff --git a/net/py-ldap1/pkg-plist b/net/py-ldap1/pkg-plist
index 757f576fbcd9..a9457c11bd86 100644
--- a/net/py-ldap1/pkg-plist
+++ b/net/py-ldap1/pkg-plist
@@ -10,4 +10,3 @@ lib/%%PYTHON_VERSION%%/site-packages/python-ldap/perldap.pyo
lib/%%PYTHON_VERSION%%/site-packages/_ldapmodule.so
lib/%%PYTHON_VERSION%%/site-packages/ldap.pth
@dirrm lib/%%PYTHON_VERSION%%/site-packages/python-ldap
-@dirrm lib/%%PYTHON_VERSION%%/site-packages
diff --git a/net/py-ldap2/Makefile b/net/py-ldap2/Makefile
index 06491c2296a4..e1f6b4095e78 100644
--- a/net/py-ldap2/Makefile
+++ b/net/py-ldap2/Makefile
@@ -6,14 +6,14 @@
PORTNAME= ldapmodule
PORTVERSION= 1.10alpha3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net
MASTER_SITES= ftp://python-ldap.sourceforge.net/pub/python-ldap/
DISTNAME= python-ldap-${PORTVERSION}-src
MAINTAINER= dirk.meyer@dinoex.sub.org
-LIB_DEPENDS= ldap.1:${PORTSDIR}/net/openldap
+LIB_DEPENDS= ldap:${PORTSDIR}/net/openldap2
BUILD_DEPENDS= python:${PORTSDIR}/lang/python
RUN_DEPENDS= python:${PORTSDIR}/lang/python
diff --git a/net/py-ldap2/files/patch-Makefile.in b/net/py-ldap2/files/patch-Makefile.in
new file mode 100644
index 000000000000..17e51a4a0584
--- /dev/null
+++ b/net/py-ldap2/files/patch-Makefile.in
@@ -0,0 +1,11 @@
+--- Makefile.in.orig Wed May 23 09:11:33 2001
++++ Makefile.in Wed May 23 09:12:10 2001
+@@ -26,6 +26,8 @@
+ $(INSTALL_DIR) $(DESTDIR)$(LIBDEST)/site-packages/python-ldap
+ $(INSTALL_DATA) $(srcdir)/Misc/ldap.pth \
+ $(DESTDIR)$(LIBDEST)/site-packages/ldap.pth
++ $(INSTALL_DATA) $(srcdir)/Modules/_ldapmodule.so \
++ $(DESTDIR)$(LIBDEST)/site-packages/_ldapmodule.so
+ for f in $(srcdir)/Lib/*.py; do \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(LIBDEST)/site-packages/python-ldap/;\
+ done
diff --git a/net/py-ldap2/files/patch-constants.c b/net/py-ldap2/files/patch-constants.c
new file mode 100644
index 000000000000..65b496acb045
--- /dev/null
+++ b/net/py-ldap2/files/patch-constants.c
@@ -0,0 +1,156 @@
+--- Modules/constants.c.orig Sun Aug 13 16:00:59 2000
++++ Modules/constants.c Mon Nov 6 11:02:43 2000
+@@ -66,7 +66,6 @@
+ add_int(d,VERSION1);
+ add_int(d,VERSION2);
+ add_int(d,VERSION);
+- add_int(d,MAX_ATTR_LEN);
+ add_int(d,TAG_MESSAGE);
+ add_int(d,TAG_MSGID);
+
+@@ -79,9 +78,27 @@
+ add_int(d,REQ_MODRDN);
+ add_int(d,REQ_COMPARE);
+ add_int(d,REQ_ABANDON);
++
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int(d,VERSION3);
++ add_int(d,VERSION_MIN);
++ add_int(d,VERSION_MAX);
++ add_int(d,TAG_LDAPDN);
++ add_int(d,TAG_LDAPCRED);
++ add_int(d,TAG_CONTROLS);
++ add_int(d,TAG_REFERRAL);
++
++ add_int(d,REQ_MODDN);
++ add_int(d,REQ_RENAME);
++#else
++ /* OpenLDAPv1 */
++ add_int(d,MAX_ATTR_LEN);
++
+ add_int(d,REQ_UNBIND_30);
+ add_int(d,REQ_DELETE_30);
+ add_int(d,REQ_ABANDON_30);
++#endif
+
+ /* reversibles */
+
+@@ -89,6 +106,14 @@
+ PyDict_SetItem( reverse, zero, Py_None );
+ Py_DECREF( zero );
+
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int_r(d,RES_SEARCH_REFERENCE);
++ add_int_r(d,RES_MODDN); /* Aliases for RES_MODRDN; */
++ add_int_r(d,RES_RENAME); /* init them before the main name */
++ add_int(d,RES_UNSOLICITED);
++#endif
++
+ add_int_r(d,RES_BIND);
+ add_int_r(d,RES_SEARCH_ENTRY);
+ add_int_r(d,RES_SEARCH_RESULT);
+@@ -106,9 +131,6 @@
+ add_int(d,AUTH_KRBV4);
+ add_int(d,AUTH_KRBV41);
+ add_int(d,AUTH_KRBV42);
+- add_int(d,AUTH_SIMPLE_30);
+- add_int(d,AUTH_KRBV41_30);
+- add_int(d,AUTH_KRBV42_30);
+ add_int(d,FILTER_AND);
+ add_int(d,FILTER_OR);
+ add_int(d,FILTER_NOT);
+@@ -118,13 +140,9 @@
+ add_int(d,FILTER_LE);
+ add_int(d,FILTER_PRESENT);
+ add_int(d,FILTER_APPROX);
+- add_int(d,FILTER_PRESENT_30);
+ add_int(d,SUBSTRING_INITIAL);
+ add_int(d,SUBSTRING_ANY);
+ add_int(d,SUBSTRING_FINAL);
+- add_int(d,SUBSTRING_INITIAL_30);
+- add_int(d,SUBSTRING_ANY_30);
+- add_int(d,SUBSTRING_FINAL_30);
+ add_int(d,SCOPE_BASE);
+ add_int(d,SCOPE_ONELEVEL);
+ add_int(d,SCOPE_SUBTREE);
+@@ -133,6 +151,16 @@
+ add_int(d,MOD_REPLACE);
+ add_int(d,MOD_BVALUES);
+
++#if !defined(LDAP_API_VERSION)
++ /* OpenLDAPv1 */
++ add_int(d,AUTH_SIMPLE_30);
++ add_int(d,AUTH_KRBV41_30);
++ add_int(d,AUTH_KRBV42_30);
++ add_int(d,FILTER_PRESENT_30);
++ add_int(d,SUBSTRING_INITIAL_30);
++ add_int(d,SUBSTRING_ANY_30);
++ add_int(d,SUBSTRING_FINAL_30);
++
+ /* (errors.c contains the error constants) */
+
+ add_int(d,DEFAULT_REFHOPLIMIT);
+@@ -145,15 +173,36 @@
+ #ifdef LDAP_CACHE_OPT_CACHEALLERRS
+ add_int(d,CACHE_OPT_CACHEALLERRS);
+ #endif
++
++#endif /* !defined(LDAP_API_VERSION) */
+ add_int(d,FILT_MAXSIZ);
+ add_int(d,DEREF_NEVER);
+ add_int(d,DEREF_SEARCHING);
+ add_int(d,DEREF_FINDING);
+ add_int(d,DEREF_ALWAYS);
+ add_int(d,NO_LIMIT);
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int(d,OPT_API_INFO);
++ add_int(d,OPT_DESC);
++ add_int(d,OPT_DEREF);
++ add_int(d,OPT_SIZELIMIT);
++ add_int(d,OPT_TIMELIMIT);
++ add_int(d,OPT_PROTOCOL_VERSION);
++ add_int(d,OPT_SERVER_CONTROLS);
++ add_int(d,OPT_CLIENT_CONTROLS);
++ add_int(d,OPT_API_FEATURE_INFO);
++ add_int(d,OPT_HOST_NAME);
++ add_int(d,OPT_ERROR_NUMBER);
++ add_int(d,OPT_ERROR_STRING);
++ add_int(d,OPT_MATCHED_DN);
++ add_int(d,OPT_PRIVATE_EXTENSION_BASE);
++#else
++ /* OpenLDAPv1 */
+ #ifdef LDAP_OPT_DNS
+ add_int(d,OPT_DNS);
+ #endif
++#endif /* defined(LDAP_API_VERSION) */
+ #ifdef LDAP_OPT_REFERRALS
+ add_int(d,OPT_REFERRALS);
+ #endif
+@@ -161,9 +210,24 @@
+
+ /* XXX - these belong in errors.c */
+
++#if defined(LDAP_API_VERSION)
++ /* OpenLDAPv2 */
++ add_int(d,URL_SUCCESS);
++ add_int(d,URL_ERR_PARAM);
++ add_int(d,URL_ERR_BADSCHEME);
++ add_int(d,URL_ERR_BADENCLOSURE);
++ add_int(d,URL_ERR_BADURL);
++ add_int(d,URL_ERR_BADHOST);
++ add_int(d,URL_ERR_BADATTRS);
++ add_int(d,URL_ERR_BADSCOPE);
++ add_int(d,URL_ERR_BADFILTER);
++ add_int(d,URL_ERR_BADEXTS);
++#else
++ /* OpenLDAPv1 */
+ add_int(d,URL_ERR_NOTLDAP);
+ add_int(d,URL_ERR_NODN);
+ add_int(d,URL_ERR_BADSCOPE);
++#endif /* defined(LDAP_API_VERSION) */
+ add_int(d,URL_ERR_MEM);
+
+ /* author */
diff --git a/net/py-ldap2/files/patch-errors.c b/net/py-ldap2/files/patch-errors.c
new file mode 100644
index 000000000000..86d6baa60aba
--- /dev/null
+++ b/net/py-ldap2/files/patch-errors.c
@@ -0,0 +1,115 @@
+--- Modules/errors.c.orig Wed Nov 15 10:41:35 2000
++++ Modules/errors.c Wed Nov 15 14:17:15 2000
+@@ -17,7 +17,13 @@
+
+ /* list of error objects */
+
++#if defined(LDAP_API_VERSION)
++/* OpenLDAPv2 */
++#define NUM_LDAP_ERRORS LDAP_REFERRAL_LIMIT_EXCEEDED+1
++#else
++/* OpenLDAPv1 */
+ #define NUM_LDAP_ERRORS LDAP_NO_MEMORY+1
++#endif
+ static PyObject*
+ errobjects[ NUM_LDAP_ERRORS ];
+
+@@ -30,21 +36,26 @@
+ PyErr_SetFromErrno( LDAPexception_class );
+ return NULL;
+ }
+-#ifdef LDAP_TYPE_IS_OPAQUE
++#if defined(LDAP_TYPE_IS_OPAQUE) && !defined(LDAP_API_VERSION)
+ else {
+ PyErr_SetString(LDAPexception_class,
+ "unknown error (C API does not expose error)");
+ return NULL;
+ }
+-#else
++#else /* defined(LDAP_TYPE_IS_OPAQUE) && !defined(LDAP_API_VERSION) */
+ else {
+ int errnum;
+ PyObject *errobj;
+ PyObject *info;
+ PyObject *str;
+
++#if defined(LDAP_API_VERSION)
++ char *matched, *error;
++ if (ldap_get_option(l, LDAP_OPT_ERROR_NUMBER, &errnum) < 0)
++#else
+ errnum = l->ld_errno;
+ if (errnum<0 || errnum>=NUM_LDAP_ERRORS)
++#endif /* defined(LDAP_API_VERSION) */
+ errobj = LDAPexception_class; /* unknown error XXX */
+ else
+ errobj = errobjects[errnum];
+@@ -61,6 +72,35 @@
+ PyDict_SetItemString( info, "desc", str );
+ Py_XDECREF(str);
+
++#if defined(LDAP_API_VERSION)
++ if (ldap_get_option(l, LDAP_OPT_MATCHED_DN, &matched) >= 0
++ && matched != NULL) {
++ if (*matched != '\0') {
++ str = PyString_FromString(matched);
++ if (str)
++ PyDict_SetItemString( info, "matched", str );
++ Py_XDECREF(str);
++ }
++ ldap_memfree(matched);
++ }
++
++ if (errnum == LDAP_REFERRAL) {
++ str = PyString_FromString(msg);
++ if (str)
++ PyDict_SetItemString( info, "info", str );
++ Py_XDECREF(str);
++ } else if (ldap_get_option(l, LDAP_OPT_ERROR_STRING, &error) >= 0
++ && error != NULL) {
++ if (error != '\0') {
++ str = PyString_FromString(error);
++ if (str)
++ PyDict_SetItemString( info, "info", str );
++ Py_XDECREF(str);
++ }
++ ldap_memfree(error);
++ }
++
++#else /* defined(LDAP_API_VERSION) */
+ if (l->ld_matched != NULL && *l->ld_matched != '\0')
+ {
+ str = PyString_FromString(l->ld_matched);
+@@ -76,11 +116,12 @@
+ PyDict_SetItemString( info, "info", str );
+ Py_XDECREF(str);
+ }
++#endif /* defined(LDAP_API_VERSION) */
+ PyErr_SetObject( errobj, info );
+ Py_DECREF(info);
+ return NULL;
+ }
+-#endif
++#endif /* defined(LDAP_TYPE_IS_OPAQUE) && !defined(LDAP_API_VERSION) */
+ }
+
+
+@@ -163,4 +204,19 @@
+ seterrobj(USER_CANCELLED);
+ seterrobj(PARAM_ERROR);
+ seterrobj(NO_MEMORY);
++#if defined(LDAP_API_VERSION)
++ seterrobj(REFERRAL);
++ seterrobj(ADMINLIMIT_EXCEEDED);
++ seterrobj(UNAVAILABLE_CRITICAL_EXTENSION);
++ seterrobj(CONFIDENTIALITY_REQUIRED);
++ seterrobj(SASL_BIND_IN_PROGRESS);
++ seterrobj(AFFECTS_MULTIPLE_DSAS);
++ seterrobj(CONNECT_ERROR);
++ seterrobj(NOT_SUPPORTED);
++ seterrobj(CONTROL_NOT_FOUND);
++ seterrobj(NO_RESULTS_RETURNED);
++ seterrobj(MORE_RESULTS_TO_RETURN);
++ seterrobj(CLIENT_LOOP);
++ seterrobj(REFERRAL_LIMIT_EXCEEDED);
++#endif
+ }
diff --git a/net/py-ldap2/files/patch-message.c b/net/py-ldap2/files/patch-message.c
new file mode 100644
index 000000000000..1b7111a84ae2
--- /dev/null
+++ b/net/py-ldap2/files/patch-message.c
@@ -0,0 +1,43 @@
+--- Modules/message.c.orig Wed Nov 15 10:41:35 2000
++++ Modules/message.c Wed Nov 15 16:51:18 2000
+@@ -114,6 +114,40 @@
+ PyList_Append(result, entrytuple);
+ Py_DECREF(entrytuple);
+ }
++#if defined(LDAP_API_VERSION)
++ for(entry = ldap_first_reference(ld,m);
++ entry != NULL;
++ entry = ldap_next_reference(ld,entry))
++ {
++ char **refs = NULL;
++ PyObject* entrytuple;
++ PyObject* reflist = PyList_New(0);
++
++ if (reflist == NULL) {
++ Py_DECREF(result);
++ ldap_msgfree( m );
++ return NULL;
++ }
++ if (ldap_parse_reference(ld, entry, &refs, NULL, 0) != LDAP_SUCCESS) {
++ Py_DECREF(result);
++ ldap_msgfree( m );
++ return LDAPerror( ld, "ldap_parse_reference" );
++ }
++ if (refs) {
++ int i;
++ for (i=0; refs[i] != NULL; i++) {
++ PyObject *refstr = PyString_FromString(refs[i]);
++ PyList_Append(reflist, refstr);
++ Py_DECREF(refstr);
++ }
++ ber_memvfree( (void **) refs );
++ }
++ entrytuple = Py_BuildValue("(sO)", NULL, reflist);
++ Py_DECREF(reflist);
++ PyList_Append(result, entrytuple);
++ Py_DECREF(entrytuple);
++ }
++#endif
+ ldap_msgfree( m );
+ return result;
+ }
diff --git a/net/py-ldap2/pkg-plist b/net/py-ldap2/pkg-plist
index 757f576fbcd9..a9457c11bd86 100644
--- a/net/py-ldap2/pkg-plist
+++ b/net/py-ldap2/pkg-plist
@@ -10,4 +10,3 @@ lib/%%PYTHON_VERSION%%/site-packages/python-ldap/perldap.pyo
lib/%%PYTHON_VERSION%%/site-packages/_ldapmodule.so
lib/%%PYTHON_VERSION%%/site-packages/ldap.pth
@dirrm lib/%%PYTHON_VERSION%%/site-packages/python-ldap
-@dirrm lib/%%PYTHON_VERSION%%/site-packages