Hi all, This is the bind-to-ldap-server and the v2-v3-compatibility bits of the LDAP patch. (The rest of the patch was left out of the Makefile.in)
It builds fine on my Linux machine, I'm keen to find out of anywhere
where it doesn't.
The changes to configure.in cause LDAP to be linked in only if the
--with-ldap flag is included - thus existing configs should still work.
If it breaks anything, please tell me...
The files are:
include/apr_ldap.h.in
ldap/Makefile.in
ldap/apr_ldap_compat.c
Regards,
Graham
--
-----------------------------------------
[EMAIL PROTECTED] "There's a moon
over Bourbon Street
tonight..."diff -u -r /home/minfrin/src/apache/pristine/apr-util/Makefile.in
apr-util/Makefile.in
--- /home/minfrin/src/apache/pristine/apr-util/Makefile.in Thu Aug 2
00:48:19 2001
+++ apr-util/Makefile.in Thu Aug 2 01:10:48 2001
@@ -11,7 +11,7 @@
# bring in rules.mk for standard functionality
@INCLUDE_RULES@
-SUBDIRS = buckets crypto dbm encoding hooks uri xml misc
+SUBDIRS = buckets crypto dbm encoding hooks ldap uri xml misc
CLEAN_SUBDIRS = . test
CLEAN_TARGETS = $(TARGET_EXPORTS)
diff -u -r /home/minfrin/src/apache/pristine/apr-util/build/apu-conf.m4
apr-util/build/apu-conf.m4
--- /home/minfrin/src/apache/pristine/apr-util/build/apu-conf.m4 Thu Aug
2 00:48:21 2001
+++ apr-util/build/apu-conf.m4 Wed Aug 8 23:00:41 2001
@@ -413,3 +413,78 @@
APR_ADDTO(APRUTIL_EXPORT_LIBS, [$expat_libs])
dnl ### export the Expat includes?
])
+
+
+dnl
+dnl Find a particular LDAP library
+dnl
+AC_DEFUN(APU_FIND_LDAPLIB,[
+ if test ${apu_has_ldap} != "define"; then
+ ldaplib=$1
+ extralib=$2
+ unset ac_cv_lib_${ldaplib}_ldap_init
+ AC_CHECK_LIB(${ldaplib}, ldap_init,
+ [
+dnl APR_ADDTO(CPPFLAGS,[-DAPU_HAS_LDAP])
+ APR_ADDTO(LIBS,[-l${ldaplib} ${extralib}])
+ APR_ADDTO(APRUTIL_EXPORT_LIBS,[-l${ldaplib} ${extralib}])
+ AC_CHECK_LIB(${ldaplib}, ldapssl_install_routines,
apu_has_ldap_netscape_ssl="define", , ${extralib})
+ AC_CHECK_LIB(${ldaplib}, ldap_start_tls_s,
apu_has_ldap_starttls="define", , ${extralib})
+ apu_has_ldap="define";
+ ], , ${extralib})
+ fi
+])
+
+
+dnl
+dnl APU_FIND_LDAP: figure out where LDAP is located
+dnl
+AC_DEFUN(APU_FIND_LDAP,[
+
+echo $ac_n "${nl}checking for ldap support...${nl}"
+
+AC_ARG_WITH(ldap-include, --with-ldap-include=path path to ldap include
files with trailing slash)
+AC_ARG_WITH(ldap-lib, --with-ldap-lib=path path to ldap lib file)
+AC_ARG_WITH(ldap, --with-ldap=library ldap library to use,
+ [
+ if test -n "$with_ldap_include"; then
+ APR_ADDTO(CPPFLAGS, [-I$with_ldap_include])
+ fi
+ if test -n "$with_ldap_lib"; then
+ APR_ADDTO(LDFLAGS, [-L$with_ldap_lib])
+ fi
+
+ apu_has_ldap="undef";
+ apu_has_ldap_netscape_ssl="undef"
+ apu_has_ldap_starttls="undef"
+
+ LIBLDAP="$withval"
+ if test "$LIBLDAP" = "yes"; then
+dnl The iPlanet C SDK 5.0 is as yet untested...
+ APU_FIND_LDAPLIB("ldap50", "-lnspr4 -lplc4 -lplds4 -liutil50 -llber50
-lldif50 -lnss3 -lprldap50 -lssl3 -lssldap50")
+ APU_FIND_LDAPLIB("ldapssl41", "-lnspr3 -lplc3 -lplds3")
+ APU_FIND_LDAPLIB("ldapssl40")
+ APU_FIND_LDAPLIB("ldapssl30")
+ APU_FIND_LDAPLIB("ldapssl20")
+ APU_FIND_LDAPLIB("ldap", "-llber")
+ else
+ APU_FIND_LDAPLIB($LDAPLIB)
+ fi
+
+ test ${apu_has_ldap} != "define" && AC_MSG_ERROR(could not find an LDAP
library)
+ AC_CHECK_LIB(lber, ber_init)
+
+ AC_CHECK_HEADERS(ldap.h, ldap_h=["#include <ldap.h>"])
+ AC_CHECK_HEADERS(lber.h, lber_h=["#include <lber.h>"])
+ AC_CHECK_HEADERS(ldap_ssl.h, ldap_ssl_h=["#include <ldap_ssl.h>"])
+
+AC_SUBST(apu_has_ldap_netscape_ssl)
+AC_SUBST(apu_has_ldap_starttls)
+AC_SUBST(ldap_h)
+AC_SUBST(lber_h)
+AC_SUBST(ldap_ssl_h)
+AC_SUBST(apu_has_ldap)
+
+ ])
+
+])
diff -u -r /home/minfrin/src/apache/pristine/apr-util/configure.in
apr-util/configure.in
--- /home/minfrin/src/apache/pristine/apr-util/configure.in Thu Aug 2
00:48:20 2001
+++ apr-util/configure.in Wed Aug 8 22:38:32 2001
@@ -50,6 +50,7 @@
dnl 3. Find Expat
dnl
APU_FIND_APR
+APU_FIND_LDAP
APU_CHECK_DBM
APU_FIND_EXPAT
@@ -104,10 +105,11 @@
dnl
dnl everthing is done.
-MAKEFILES="Makefile buckets/Makefile crypto/Makefile dbm/Makefile
dbm/sdbm/Makefile encoding/Makefile hooks/Makefile uri/Makefile xml/Makefile
misc/Makefile $test_Makefile"
+MAKEFILES="Makefile buckets/Makefile crypto/Makefile dbm/Makefile
dbm/sdbm/Makefile encoding/Makefile hooks/Makefile ldap/Makefile uri/Makefile
xml/Makefile misc/Makefile $test_Makefile"
AC_OUTPUT([
export_vars.sh
include/private/apu_select_dbm.h
+ include/apr_ldap.h
include/apu.h
$MAKEFILES
])
/* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ /* * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h */ #ifndef APU_LDAP_H #define APU_LDAP_H /* * This switches LDAP support on or off. */ /* this will be defined if LDAP support was compiled into apr-util */ [EMAIL PROTECTED]@ APU_HAS_LDAP /* this whole thing disappears if LDAP is not enabled */ #ifdef APU_HAS_LDAP /* LDAP secure capabilities */ [EMAIL PROTECTED]@ APU_HAS_LDAP_NETSCAPE_SSL [EMAIL PROTECTED]@ APU_HAS_LDAP_STARTTLS /* LDAP header files */ @ldap_h@ @lber_h@ @ldap_ssl_h@ /* * LDAP Compatibility */ #if LDAP_VERSION_MAX <= 2 int ldap_search_ext_s(LDAP *ldap, char *base, int scope, char *filter, char **attrs, int attrsonly, void *servertrls, void *clientctrls, void *timeout, int sizelimit, LDAPMessage **res); void ldap_memfree(void *p); /* The const_cast is used to get around the fact that some of the LDAPv2 prototypes * have non-const parameters, while the same ones in LDAPv3 are const. If compiling * with LDAPv2, the const_cast casts away the constness, but won't under LDAPv3 */ #define const_cast(x) ((char *)(x)) #else #define const_cast(x) (x) #endif /* LDAP_VERSION_MAX */ /* Define some errors that are mysteriously gone from OpenLDAP 2.x */ #ifndef LDAP_URL_ERR_NOTLDAP #define LDAP_URL_ERR_NOTLDAP LDAP_URL_ERR_BADSCHEME #endif #ifndef LDAP_URL_ERR_NODN #define LDAP_URL_ERR_NODN LDAP_URL_ERR_BADURL #endif #endif /* APU_HAS_LDAP */ #endif /* APU_LDAP_H */
[EMAIL PROTECTED]@ INCLUDES=-I$(top_builddir)/include -I$(top_builddir)/../apr/include TARGETS = apr_ldap_compat.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@
/* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ /* * apr_ldap_compat.c: LDAP v2/v3 compatibility things * * Original code from auth_ldap module for Apache v1.3: * Copyright 1998, 1999 Enbridge Pipelines Inc. * Copyright 1999-2001 Dave Carrigan */ #include <apr_ldap.h> #ifdef APU_HAS_LDAP /* * Compatibility for LDAPv2 libraries. Differences between LDAPv2 and * LDAPv3, as they affect this module * * LDAPv3 uses ldap_search_ext_s; LDAPv2 uses only basic ldap_search_s * * LDAPv3 uses ldap_memfree; LDAPv2 just uses free(). * * In this section, we just implement the LDAPv3 SDK functions that are * missing in LDAPv2. * */ #if LDAP_VERSION_MAX == 2 /* * LDAPv2 doesn't support extended search. Since auth_ldap doesn't use * it anyway, we just translate the extended search into a normal search. */ int ldap_search_ext_s(LDAP *ldap, char *base, int scope, char *filter, char **attrs, int attrsonly, void *servertrls, void *clientctrls, void *timeout, int sizelimit, LDAPMessage **res) { return ldap_search_s(ldap, base, scope, filter, attrs, attrsonly, res); } void ldap_memfree(void *p) { free(p); } #endif /* if LDAP_VERSION_MAX */ #endif /* APU_HAS_LDAP */
smime.p7s
Description: S/MIME Cryptographic Signature
