From 49e523e56f81f255d792c5ae2ff24cedc3cbc3a0 Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Wed, 22 Dec 2021 13:36:39 +0100 Subject: [PATCH] Avoid conflict with ldap_connect function of openldap ldap_connect is defined by OpenLDAP 2.6. Compiler complains there are conflicting declarations. Use dlz_ldap prefix instead of ldap to avoid conflict. --- contrib/dlz/modules/ldap/dlz_ldap_dynamic.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c b/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c index 543a95d7a8..681c5995ba 100644 --- a/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c +++ b/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c @@ -193,7 +193,7 @@ cleanup: /*% Connects / reconnects to LDAP server */ static isc_result_t -ldap_connect(ldap_instance_t *dbi, dbinstance_t *dbc) { +dlz_ldap_connect(ldap_instance_t *dbi, dbinstance_t *dbc) { isc_result_t result; int ldap_result; @@ -700,7 +700,8 @@ ldap_get_results(const char *zone, const char *record, const char *client, db->log(ISC_LOG_INFO, "LDAP driver attempting to " "re-connect"); - result = ldap_connect((ldap_instance_t *)dbdata, dbi); + result = dlz_ldap_connect((ldap_instance_t *)dbdata, + dbi); if (result != ISC_R_SUCCESS) { result = ISC_R_FAILURE; continue; @@ -731,7 +732,8 @@ ldap_get_results(const char *zone, const char *record, const char *client, case LDAP_SERVER_DOWN: db->log(ISC_LOG_INFO, "LDAP driver attempting to " "re-connect"); - result = ldap_connect((ldap_instance_t *)dbdata, dbi); + result = dlz_ldap_connect((ldap_instance_t *)dbdata, + dbi); if (result != ISC_R_SUCCESS) { result = ISC_R_FAILURE; } @@ -1117,7 +1119,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata, ldap->db = dbi; #endif /* if PTHREADS */ /* attempt to connect */ - result = ldap_connect(ldap, dbi); + result = dlz_ldap_connect(ldap, dbi); /* * if db connection cannot be created, log err msg and