diff --git a/backport-bind-dyndb-ldap-bind-9.18.24.patch b/backport-bind-dyndb-ldap-bind-9.18.24.patch new file mode 100644 index 0000000000000000000000000000000000000000..db720b24424ca1fd5d3551321d74001f38a907bf --- /dev/null +++ b/backport-bind-dyndb-ldap-bind-9.18.24.patch @@ -0,0 +1,32 @@ +From 628db201764a0dc76f8e48c1524850de64e2f2fe Mon Sep 17 00:00:00 2001 +From: Alexander Bokovoy +Date: Wed, 14 Feb 2024 15:45:57 +0200 +Subject: [PATCH] Include dydnb-config.h prior to any BIND headers + +Signed-off-by: Alexander Bokovoy +--- + src/syncrepl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/syncrepl.c b/src/syncrepl.c +index f94379c..4725bb8 100644 +--- a/src/syncrepl.c ++++ b/src/syncrepl.c +@@ -4,6 +4,7 @@ + + #include + ++#include "dyndb-config.h" + #include + #include + #include +@@ -11,7 +12,6 @@ + #include + #include + +-#include "dyndb-config.h" + #include "ldap_helper.h" + #include "util.h" + #include "semaphore.h" +-- +2.43.0 \ No newline at end of file diff --git a/bind-dyndb-ldap-fix-clang-atomic.patch b/bind-dyndb-ldap-fix-clang-atomic.patch new file mode 100644 index 0000000000000000000000000000000000000000..7d54a802f40dc6fac150993243fb7acc94febe26 --- /dev/null +++ b/bind-dyndb-ldap-fix-clang-atomic.patch @@ -0,0 +1,95 @@ +diff -u -r bind-dyndb-ldap-11.10/src/ldap_driver.c bind-dyndb-ldap-11.10/src/ldap_driver.c +--- bind-dyndb-ldap-11.10/src/ldap_driver.c 2022-06-21 14:59:52.000000000 +0800 ++++ bind-dyndb-ldap-11.10/src/ldap_driver.c 2023-05-08 11:35:51.000000000 +0800 +@@ -69,7 +69,7 @@ + + struct ldapdb { + dns_db_t common; +- isc_refcount_t refs; ++ _Atomic unsigned long refs; + ldap_instance_t *ldap_inst; + + /** +@@ -134,10 +134,10 @@ + + REQUIRE(VALID_LDAPDB(ldapdb)); + +-#if LIBDNS_VERSION_MAJOR < 1600 +- isc_refcount_increment(&ldapdb->refs, NULL); ++ #if LIBDNS_VERSION_MAJOR < 1600 ++ atomic_fetch_add_explicit(&ldapdb->refs, 1, memory_order_relaxed); + #else +- isc_refcount_increment(&ldapdb->refs); ++ atomic_fetch_add_explicit(&ldapdb->refs, 1, memory_order_relaxed); + #endif + *targetp = source; + } +diff -u -r bind-dyndb-ldap-11.10/src/ldap_helper.c bind-dyndb-ldap-11.10/src/ldap_helper.c +--- bind-dyndb-ldap-11.10/src/ldap_helper.c 2022-06-21 14:59:52.000000000 +0800 ++++ bind-dyndb-ldap-11.10/src/ldap_helper.c 2023-05-08 11:36:52.000000000 +0800 +@@ -166,7 +166,7 @@ + isc_thread_t watcher; + bool exiting; + /* Non-zero if this instance is 'tainted' by an unrecoverable problem. */ +- isc_refcount_t errors; ++ _Atomic unsigned long errors; + + /* Settings. */ + settings_set_t *local_settings; +diff -u -r bind-dyndb-ldap-11.10/src/mldap.c bind-dyndb-ldap-11.10/src/mldap.c +--- bind-dyndb-ldap-11.10/src/mldap.c 2022-06-21 14:59:52.000000000 +0800 ++++ bind-dyndb-ldap-11.10/src/mldap.c 2023-05-08 11:30:40.000000000 +0800 +@@ -65,7 +65,7 @@ + struct mldapdb { + isc_mem_t *mctx; + metadb_t *mdb; +- isc_refcount_t generation; ++ _Atomic unsigned long generation; + }; + + +@@ -80,7 +80,7 @@ + ZERO_PTR(mldap); + isc_mem_attach(mctx, &mldap->mctx); + +- isc_refcount_init(&mldap->generation, 0); ++ atomic_init(&mldap->generation, 0); + CHECK(metadb_new(mctx, &mldap->mdb)); + + *mldapp = mldap; +diff -u -r bind-dyndb-ldap-11.10/src/syncrepl.c bind-dyndb-ldap-11.10/src/syncrepl.c +--- bind-dyndb-ldap-11.10/src/syncrepl.c 2022-06-21 14:59:52.000000000 +0800 ++++ bind-dyndb-ldap-11.10/src/syncrepl.c 2023-05-08 22:41:58.000000000 +0800 +@@ -87,7 +87,7 @@ + * @see ldap_sync_search_entry() + */ + struct sync_ctx { +- isc_refcount_t task_cnt; /**< provides atomic access */ ++ _Atomic unsigned long task_cnt; /**< provides atomic access */ + isc_mem_t *mctx; + /** limit number of unprocessed LDAP events in queue + * (memory consumption is one of problems) */ +@@ -211,9 +211,9 @@ + + bev = (sync_barrierev_t *)event; + #if LIBDNS_VERSION_MAJOR < 1600 +- isc_refcount_decrement(&bev->sctx->task_cnt, &cnt); ++ cnt = atomic_fetch_sub_explicit(&bev->sctx->task_cnt, 1, memory_order_acq_rel); + #else +- cnt = isc_refcount_decrement(&bev->sctx->task_cnt); ++ cnt = atomic_fetch_sub_explicit(&bev->sctx->task_cnt, 1, memory_order_acq_rel); + #endif + if (cnt == REFCOUNT_FLOOR) { + sync_barrierev_t *fev = NULL; +@@ -336,9 +336,9 @@ + UNLINK(sctx->tasks, taskel, link); + isc_task_detach(&taskel->task); + #if LIBDNS_VERSION_MAJOR < 1600 +- isc_refcount_decrement(&sctx->task_cnt, NULL); ++ (void)atomic_fetch_sub_explicit(&sctx->task_cnt, 1, memory_order_acq_rel); + #else +- (void)isc_refcount_decrement(&sctx->task_cnt); ++ (void)atomic_fetch_sub_explicit(&sctx->task_cnt, 1, memory_order_acq_rel); + #endif + SAFE_MEM_PUT_PTR(sctx->mctx, taskel); + } diff --git a/bind-dyndb-ldap.spec b/bind-dyndb-ldap.spec index 79aceb5240a5e8df9af24f4c6503450441eb1ca5..a2de4b6cd5b64268a6c532005f7fe9021ae9d05c 100644 --- a/bind-dyndb-ldap.spec +++ b/bind-dyndb-ldap.spec @@ -5,7 +5,7 @@ Name: bind-dyndb-ldap Version: 11.10 -Release: 2 +Release: 4 Summary: LDAP back-end plug-in for BIND License: GPLv2+ URL: https://releases.pagure.org/bind-dyndb-ldap @@ -19,6 +19,11 @@ Patch4: bind-dyndb-ldap-11.10-bind-9.18.11.patch Patch5: backport-bind-dyndb-ldap-11.10-bind-9.18.13.patch Patch6: backport-bind-dyndb-ldap-11.10-bind-9.18.19.patch Patch7: backport-bind-dyndb-ldap-11.10-dns_name_init.patch +Patch8: backport-bind-dyndb-ldap-bind-9.18.24.patch + +%if "%toolchain" == "clang" +Patch9000: bind-dyndb-ldap-fix-clang-atomic.patch +%endif BuildRequires: bind-devel >= %{bind_version} BuildRequires: krb5-devel @@ -100,6 +105,16 @@ sed -i.bak -e "$SEDSCRIPT" /etc/named.conf %changelog +* Fri Mar 22 2024 yoo - 11.10-4 +- fix clang build error: Atomic +- Signed-off-by: shafeipaozi + +* Wed Mar 20 2024 xinghe - 11.10-3 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix build failed + * Tue Mar 05 2024 xinghe - 11.10-2 - Type:bugfix - CVE:NA