Skip to content

Commit

Permalink
apr_ldap: Add write capability to the LDAP API. Support for
Browse files Browse the repository at this point in the history
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
  • Loading branch information
minfrin committed Mar 11, 2025
1 parent d6bb3f9 commit c4b0627
Show file tree
Hide file tree
Showing 12 changed files with 3,768 additions and 908 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
-*- coding: utf-8 -*-
Changes for APR 2.0.0

*) apr_ldap: Add write capability to the LDAP API. Support for
add, modify, rename, delete, and extended operations.
[Graham Leggett]

*) apr_ldap: Explicitly detect the case where OpenLDAP has been
installed with SASL support, but the SASL headers are missing.
[Graham Leggett]
Expand Down
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ option(APU_HAVE_SQLITE3 "Build SQLite3 DBD driver" OFF)
option(APU_HAVE_PGSQL "Build PostgreSQL DBD driver" OFF)
option(APU_HAVE_CRYPTO "Crypto support" OFF)
option(APU_HAVE_ICONV "Xlate support" OFF)
option(APR_HAS_LDAP "LDAP support" ON)
option(APR_HAVE_IPV6 "IPv6 support" ON)
option(INSTALL_PDB "Install .pdb files (if generated)" ON)
option(APR_BUILD_TESTAPR "Build the test suite" ON)
Expand Down Expand Up @@ -112,6 +113,11 @@ if(APU_HAVE_PGSQL)
find_package(PostgreSQL REQUIRED)
endif()

set(LDAP_LIBRARIES)
if(APR_HAS_LDAP)
set(LDAP_LIBRARIES wldap32)
endif()

if(APR_POOL_DEBUG)
add_compile_definitions(APR_POOL_DEBUG=1)
endif()
Expand All @@ -132,6 +138,9 @@ string(REGEX REPLACE ".*#define APR_PATCH_VERSION[ \t]+([0-9]+).*" "\\1" APR_PAT
configure_file(include/apr.hwc
${PROJECT_BINARY_DIR}/apr.h)
# "COPYONLY" just because anything else isn't implemented ;)
configure_file(include/private/apu_ldap_internal.hw
${PROJECT_BINARY_DIR}/apu_ldap_internal.h
COPYONLY)
configure_file(include/private/apu_select_dbm.hw
${PROJECT_BINARY_DIR}/apu_select_dbm.h
COPYONLY)
Expand Down Expand Up @@ -392,6 +401,10 @@ set(APR_SOURCES
xml/apr_xml_xmllite.c
)

if(APR_HAS_LDAP)
set(APR_SOURCES ${APR_SOURCES} ldap/apr_ldap_stub.c ldap/apr_ldap_url.c)
endif()

# Sources and libraries for APR builtin drivers. Used when APR_MODULAR_DSO=OFF.
set(APR_EXTRA_SOURCES)
set(APR_EXTRA_LIBRARIES)
Expand Down Expand Up @@ -512,6 +525,14 @@ if(APU_HAVE_CRYPTO)
"OpenSSL::Crypto")
endif()

IF(APR_HAS_LDAP)
ADD_APR_MODULE(
apr_ldap-2 "apr_ldap"
"ldap/apr_ldap.c"
${LDAP_LIBRARIES}
)
ENDIF()

if(APU_HAVE_ODBC)
list(APPEND dbd_drivers odbc)

Expand Down Expand Up @@ -770,6 +791,7 @@ message(STATUS " IPv6 ............................ : ${APR_HAVE_IPV6}")
message(STATUS " DBD ODBC driver ................. : ${APU_HAVE_ODBC}")
message(STATUS " DBD SQLite3 driver .............. : ${APU_HAVE_SQLITE3}")
message(STATUS " DBD PostgreSQL .................. : ${APU_HAVE_PGSQL}")
message(STATUS " LDAP driver ..................... : ${APR_HAS_LDAP}")
message(STATUS " XML backend ..................... : ${APR_XML_BACKEND}")
message(STATUS " Have Crypto ..................... : ${APU_HAVE_CRYPTO}")
message(STATUS " Have Iconv ...................... : ${APU_HAVE_ICONV}")
Expand Down
3 changes: 3 additions & 0 deletions build/ldap.m4
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ AC_DEFUN([APU_FIND_LDAPLIB], [
[
LDADD_ldap_found="-l${ldaplib} ${extralib}"
AC_CHECK_LIB(${ldaplib}, ldap_sasl_interactive_bind, apu_have_ldap_sasl_interactive_bind="1", , ${extralib})
AC_CHECK_LIB(${ldaplib}, ldap_connect, apu_have_ldap_connect="1", , ${extralib})
apu_have_ldap="1";
], , ${extralib})
fi
Expand All @@ -108,6 +109,7 @@ AC_DEFUN([APU_FIND_LDAP], [
echo $ac_n "${nl}checking for ldap support..."
apu_have_ldap_sasl_interactive_bind="0"
apu_have_ldap_connect="0"
apu_have_ldap="0";
apu_have_ldap_openldap="0"
apu_have_ldap_microsoft="0"
Expand Down Expand Up @@ -227,6 +229,7 @@ AC_CHECK_HEADERS([sasl.h sasl/sasl.h])
AC_SUBST(ldap_h)
AC_SUBST(lber_h)
AC_SUBST(apu_have_ldap_sasl_interactive_bind)
AC_SUBST(apu_have_ldap_connect)
AC_SUBST(apu_have_ldap)
AC_SUBST(apu_have_ldap_openldap)
AC_SUBST(apu_have_ldap_solaris)
Expand Down
Loading

0 comments on commit c4b0627

Please sign in to comment.