Fix OpenLDAP 2.6 conflict

Rename internal function to not start with just ldap_ prefix. OpenLDAP
library provides such function with different parameters and compiler
cannot pass it.
This commit is contained in:
Petr Menšík 2021-12-22 13:53:11 +01:00
parent 13da6470e0
commit ec7f7e4c12
2 changed files with 61 additions and 1 deletions

View File

@ -0,0 +1,55 @@
From e6ed26c98ebac9313ce531a366f96ff9912e84af Mon Sep 17 00:00:00 2001
From: Petr Mensik <pemensik@redhat.com>
Date: Wed, 22 Dec 2021 13:36:39 +0100
Subject: [PATCH 1/2] 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 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c b/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c
index 543a95d..317a691 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,7 @@ 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 +731,7 @@ 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 +1117,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
--
2.31.1

View File

@ -53,7 +53,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv
Name: bind Name: bind
License: MPLv2.0 License: MPLv2.0
Version: 9.16.24 Version: 9.16.24
Release: 1%{?dist} Release: 2%{?dist}
Epoch: 32 Epoch: 32
Url: https://www.isc.org/downloads/bind/ Url: https://www.isc.org/downloads/bind/
# #
@ -102,6 +102,7 @@ Patch149:bind-9.11-kyua-pkcs11.patch
Patch157:bind-9.11-fips-tests.patch Patch157:bind-9.11-fips-tests.patch
# https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/2689 # https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/2689
Patch164:bind-9.11-rh1666814.patch Patch164:bind-9.11-rh1666814.patch
Patch165:bind-9.16-openldap-2.6.patch
%{?systemd_ordering} %{?systemd_ordering}
Requires: coreutils Requires: coreutils
@ -400,6 +401,7 @@ in HTML and PDF format.
%patch130 -p1 -b .libdb %patch130 -p1 -b .libdb
%patch157 -p1 -b .fips-tests %patch157 -p1 -b .fips-tests
%patch164 -p1 -b .rh1666814 %patch164 -p1 -b .rh1666814
%patch165 -p1
%if %{with PKCS11} %if %{with PKCS11}
%patch135 -p1 -b .config-pkcs11 %patch135 -p1 -b .config-pkcs11
@ -1122,6 +1124,9 @@ fi;
%endif %endif
%changelog %changelog
* Wed Dec 22 2021 Petr Menšík <pemensik@redhat.com> - 32:9.16.24-2
- Build with OpenLDAP 2.6 (#2032704)
* Wed Dec 15 2021 Petr Menšík <pemensik@redhat.com> - 32:9.16.24-1 * Wed Dec 15 2021 Petr Menšík <pemensik@redhat.com> - 32:9.16.24-1
- Update to 9.16.24 (#2032934) - Update to 9.16.24 (#2032934)