Index: lib/ldap.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/ldap.c,v
retrieving revision 1.68
diff -u -r1.68 ldap.c
--- lib/ldap.c	26 Feb 2007 04:24:26 -0000	1.68
+++ lib/ldap.c	27 Feb 2007 01:41:55 -0000
@@ -193,13 +193,18 @@
   dynafunc func = (dynafunc)ZERO_NULL;
 
 #if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL)
-  if (libldap) {
+  if (libldap && !memcmp("ldap_", name, 5)) {
     /* This typecast magic below was brought by Joe Halpin. In ISO C, you
      * cannot typecast a data pointer to a function pointer, but that's
      * exactly what we need to do here to avoid compiler warnings on picky
      * compilers! */
     *(void**) (&func) = dlsym(libldap, name);
   }
+#ifdef DL_LBER_FILE
+  else if (liblber && !memcmp("ber_", name, 4)) {
+    *(void**) (&func) = dlsym(liblber, name);
+  }
+#endif
 #elif defined(WIN32)
   if (libldap) {
     func = (dynafunc)GetProcAddress((HINSTANCE)libldap, name);
