Skip to content

Commit c4b0627

Browse files
committed
apr_ldap: Add write capability to the LDAP API. Support for
add, modify, rename, delete, and extended operations. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1924295 13f79535-47bb-0310-9956-ffa450edef68
1 parent d6bb3f9 commit c4b0627

File tree

12 files changed

+3768
-908
lines changed

12 files changed

+3768
-908
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
-*- coding: utf-8 -*-
22
Changes for APR 2.0.0
33

4+
*) apr_ldap: Add write capability to the LDAP API. Support for
5+
add, modify, rename, delete, and extended operations.
6+
[Graham Leggett]
7+
48
*) apr_ldap: Explicitly detect the case where OpenLDAP has been
59
installed with SASL support, but the SASL headers are missing.
610
[Graham Leggett]

CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ option(APU_HAVE_SQLITE3 "Build SQLite3 DBD driver" OFF)
5454
option(APU_HAVE_PGSQL "Build PostgreSQL DBD driver" OFF)
5555
option(APU_HAVE_CRYPTO "Crypto support" OFF)
5656
option(APU_HAVE_ICONV "Xlate support" OFF)
57+
option(APR_HAS_LDAP "LDAP support" ON)
5758
option(APR_HAVE_IPV6 "IPv6 support" ON)
5859
option(INSTALL_PDB "Install .pdb files (if generated)" ON)
5960
option(APR_BUILD_TESTAPR "Build the test suite" ON)
@@ -112,6 +113,11 @@ if(APU_HAVE_PGSQL)
112113
find_package(PostgreSQL REQUIRED)
113114
endif()
114115

116+
set(LDAP_LIBRARIES)
117+
if(APR_HAS_LDAP)
118+
set(LDAP_LIBRARIES wldap32)
119+
endif()
120+
115121
if(APR_POOL_DEBUG)
116122
add_compile_definitions(APR_POOL_DEBUG=1)
117123
endif()
@@ -132,6 +138,9 @@ string(REGEX REPLACE ".*#define APR_PATCH_VERSION[ \t]+([0-9]+).*" "\\1" APR_PAT
132138
configure_file(include/apr.hwc
133139
${PROJECT_BINARY_DIR}/apr.h)
134140
# "COPYONLY" just because anything else isn't implemented ;)
141+
configure_file(include/private/apu_ldap_internal.hw
142+
${PROJECT_BINARY_DIR}/apu_ldap_internal.h
143+
COPYONLY)
135144
configure_file(include/private/apu_select_dbm.hw
136145
${PROJECT_BINARY_DIR}/apu_select_dbm.h
137146
COPYONLY)
@@ -392,6 +401,10 @@ set(APR_SOURCES
392401
xml/apr_xml_xmllite.c
393402
)
394403

404+
if(APR_HAS_LDAP)
405+
set(APR_SOURCES ${APR_SOURCES} ldap/apr_ldap_stub.c ldap/apr_ldap_url.c)
406+
endif()
407+
395408
# Sources and libraries for APR builtin drivers. Used when APR_MODULAR_DSO=OFF.
396409
set(APR_EXTRA_SOURCES)
397410
set(APR_EXTRA_LIBRARIES)
@@ -512,6 +525,14 @@ if(APU_HAVE_CRYPTO)
512525
"OpenSSL::Crypto")
513526
endif()
514527

528+
IF(APR_HAS_LDAP)
529+
ADD_APR_MODULE(
530+
apr_ldap-2 "apr_ldap"
531+
"ldap/apr_ldap.c"
532+
${LDAP_LIBRARIES}
533+
)
534+
ENDIF()
535+
515536
if(APU_HAVE_ODBC)
516537
list(APPEND dbd_drivers odbc)
517538

@@ -770,6 +791,7 @@ message(STATUS " IPv6 ............................ : ${APR_HAVE_IPV6}")
770791
message(STATUS " DBD ODBC driver ................. : ${APU_HAVE_ODBC}")
771792
message(STATUS " DBD SQLite3 driver .............. : ${APU_HAVE_SQLITE3}")
772793
message(STATUS " DBD PostgreSQL .................. : ${APU_HAVE_PGSQL}")
794+
message(STATUS " LDAP driver ..................... : ${APR_HAS_LDAP}")
773795
message(STATUS " XML backend ..................... : ${APR_XML_BACKEND}")
774796
message(STATUS " Have Crypto ..................... : ${APU_HAVE_CRYPTO}")
775797
message(STATUS " Have Iconv ...................... : ${APU_HAVE_ICONV}")

build/ldap.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ AC_DEFUN([APU_FIND_LDAPLIB], [
9494
[
9595
LDADD_ldap_found="-l${ldaplib} ${extralib}"
9696
AC_CHECK_LIB(${ldaplib}, ldap_sasl_interactive_bind, apu_have_ldap_sasl_interactive_bind="1", , ${extralib})
97+
AC_CHECK_LIB(${ldaplib}, ldap_connect, apu_have_ldap_connect="1", , ${extralib})
9798
apu_have_ldap="1";
9899
], , ${extralib})
99100
fi
@@ -108,6 +109,7 @@ AC_DEFUN([APU_FIND_LDAP], [
108109
echo $ac_n "${nl}checking for ldap support..."
109110
110111
apu_have_ldap_sasl_interactive_bind="0"
112+
apu_have_ldap_connect="0"
111113
apu_have_ldap="0";
112114
apu_have_ldap_openldap="0"
113115
apu_have_ldap_microsoft="0"
@@ -227,6 +229,7 @@ AC_CHECK_HEADERS([sasl.h sasl/sasl.h])
227229
AC_SUBST(ldap_h)
228230
AC_SUBST(lber_h)
229231
AC_SUBST(apu_have_ldap_sasl_interactive_bind)
232+
AC_SUBST(apu_have_ldap_connect)
230233
AC_SUBST(apu_have_ldap)
231234
AC_SUBST(apu_have_ldap_openldap)
232235
AC_SUBST(apu_have_ldap_solaris)

0 commit comments

Comments
 (0)