From 378bc745595ec8d442c2a02d65a5fd31ea286789 Mon Sep 17 00:00:00 2001
From: Timothy Pearson <kb9vqf@pearsoncomputing.net>
Date: Mon, 29 Sep 2025 22:39:53 -0500
Subject: Update for OpenLDAP 2.5

OpenLDAP 2.5 switches from HDB to MDB.  Update schema to match.
---
 src/libtdeldap.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/libtdeldap.cpp b/src/libtdeldap.cpp
index 0e544cf..27eeb98 100644
--- a/src/libtdeldap.cpp
+++ b/src/libtdeldap.cpp
@@ -4085,7 +4085,7 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
 					mods[i] = NULL;
 
 					// Perform LDAP update
-					retcode = ldap_modify_ext_s(m_ldap, "olcDatabase={1}hdb,cn=config", mods, NULL, NULL);
+					retcode = ldap_modify_ext_s(m_ldap, "olcDatabase={1}mdb,cn=config", mods, NULL, NULL);
 
 					// Clean up
 					clean_up_attribute_operations(i, mods, prevterm, number_of_parameters);
@@ -4115,7 +4115,7 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
 					mods[i] = NULL;
 
 					// Perform LDAP update
-					retcode = ldap_modify_ext_s(m_ldap, "olcDatabase={1}hdb,cn=config", mods, NULL, NULL);
+					retcode = ldap_modify_ext_s(m_ldap, "olcDatabase={1}mdb,cn=config", mods, NULL, NULL);
 
 					// Clean up
 					clean_up_attribute_operations(i, mods, prevterm, number_of_parameters);
@@ -4222,7 +4222,7 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
 				}
 
 				haveOlcOverlaySyncProv = false;
-				retcode = ldap_search_ext_s(m_ldap, "olcDatabase={1}hdb,cn=config", LDAP_SCOPE_SUBTREE, NULL, ldap_user_and_operational_attributes, 0, NULL, NULL, NULL, 0, &msg);
+				retcode = ldap_search_ext_s(m_ldap, "olcDatabase={1}mdb,cn=config", LDAP_SCOPE_SUBTREE, NULL, ldap_user_and_operational_attributes, 0, NULL, NULL, NULL, 0, &msg);
 				if (retcode != LDAP_SUCCESS) {
 					if (errstr) *errstr = i18n("<qt>LDAP search failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode));
 					else KMessageBox::error(0, i18n("<qt>LDAP search failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
@@ -4255,7 +4255,7 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
 					mods[i] = NULL;
 
 					// Add new object
-					retcode = ldap_add_ext_s(m_ldap, "olcOverlay=syncprov,olcDatabase={1}hdb,cn=config", mods, NULL, NULL);
+					retcode = ldap_add_ext_s(m_ldap, "olcOverlay=syncprov,olcDatabase={1}mdb,cn=config", mods, NULL, NULL);
 
 					// Clean up
 					clean_up_attribute_operations(i, mods, prevterm, number_of_parameters);
@@ -4277,7 +4277,7 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
 				// See http://www.openldap.org/lists/openldap-software/200811/msg00103.html
 				// If it were possible, the code would look something like this:
 				// retcode = ldap_delete_ext_s(m_ldap, olcOverlaySyncProvAttr + ",olcDatabase={0}config,cn=config", NULL, NULL);
-				// retcode = ldap_delete_ext_s(m_ldap, olcOverlaySyncProvAttr + ",olcDatabase={1}hdb,cn=config", NULL, NULL);
+				// retcode = ldap_delete_ext_s(m_ldap, olcOverlaySyncProvAttr + ",olcDatabase={1}mdb,cn=config", NULL, NULL);
 			}
 			return 0;
 		}
-- 
cgit v1.2.3

