Skip to content

Commit

Permalink
LDAP: properly implemented as a curl_handler
Browse files Browse the repository at this point in the history
makes the LDAP code much cleaner, nicer and in general being a
better libcurl citizen. If a new enough OpenLDAP version is
detect, the new and shiny lib/openldap.c code is then used
instead of the old cruft

Code by Howard, minor cleanups by Daniel.
  • Loading branch information
Howard Chu authored and bagder committed May 24, 2010
1 parent 606b933 commit 2e05635
Show file tree
Hide file tree
Showing 9 changed files with 597 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

Changelog

Daniel Stenberg (25 May 2010)
- Howard Chu brought a patch that makes the LDAP code much cleaner, nicer and
in general being a better libcurl citizen. If a new enough OpenLDAP version
is detect, the new and shiny lib/openldap.c code is then used instead of the
old cruft.

Daniel Stenberg (21 May 2010)
- Eric Mertens posted bug #3003705: when we made TFTP use the correct timeout
option when sent to the server (fixed May 18th 2010) it became obvious that
Expand Down
1 change: 1 addition & 0 deletions RELEASE-NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This release includes the following changes:
o added support for PolarSSL
o added support for FTP wildcard matching and downloads
o added support for RTMP
o introducing new LDAP code for new enough OpenLDAP

This release includes the following bugfixes:

Expand Down
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
fi

if test x$CURL_DISABLE_LDAP != x1 ; then
AC_CHECK_FUNCS([ldap_url_parse])
AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])

if test "$LDAPLIBNAME" = "wldap32"; then
curl_ldap_msg="enabled (winldap)"
Expand All @@ -862,6 +862,9 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
esac
else
curl_ldap_msg="enabled (OpenLDAP)"
if test "x$ac_cv_func_ldap_init_fd" = x""yes; then
AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
fi
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \
socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c \
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \
warnless.c hmac.c polarssl.c curl_rtmp.c
warnless.c hmac.c polarssl.c curl_rtmp.c openldap.c

HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
Expand Down
4 changes: 2 additions & 2 deletions lib/curl_ldap.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* KIND, either express or implied.
*
***************************************************************************/
#ifndef CURL_DISABLE_LDAP
#if !defined(CURL_DISABLE_LDAP) || defined(USE_OPENLDAP)
extern const struct Curl_handler Curl_handler_ldap;

#ifdef HAVE_LDAP_SSL
#if defined(HAVE_LDAP_SSL) || defined(USE_OPENLDAP)
extern const struct Curl_handler Curl_handler_ldaps;
#endif

Expand Down
2 changes: 1 addition & 1 deletion lib/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "setup.h"

#ifndef CURL_DISABLE_LDAP
#if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP)
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
Expand Down

0 comments on commit 2e05635

Please sign in to comment.