LDAP-5648196.patch   [plain text]


--- configure.orig	2007-10-26 15:25:37.000000000 -0700
+++ configure	2007-12-14 18:37:34.000000000 -0800
@@ -18353,7 +18353,7 @@
   curl_cv_ldap_LIBS="unknown"
   #
   for x_nlibs in '' "$u_libs" \
-    '-lldap' \
+    '-Wl,-weak-lldap' \
     '-llber -lldap' \
     '-lldap -llber' \
     '-lldapssl -lldapx -lldapsdk' \
--- lib/ldap.c.orig	2007-12-14 18:53:29.000000000 -0800
+++ lib/ldap.c	2007-12-14 19:06:28.000000000 -0800
@@ -106,6 +106,8 @@
 
 #undef ldap_free_urldesc
 #define ldap_free_urldesc       _ldap_free_urldesc
+#else
+extern int ldap_url_parse(const char *, LDAPURLDesc **)  __attribute__((weak_import));
 #endif
 
 #ifdef DEBUG_LDAP
@@ -192,6 +194,11 @@
   infof(data, "LDAP local: %s\n", data->change.url);
 
 #ifdef HAVE_LDAP_URL_PARSE
+  if (ldap_url_parse == NULL) {
+    failf(data, "LDAP library not found");
+    status = CURLE_UNSUPPORTED_PROTOCOL;
+    goto quit;
+  }
   rc = ldap_url_parse(data->change.url, &ludp);
 #else
   rc = _ldap_url_parse(conn, &ludp);