[Pkg-freeipa-devel] [Git][freeipa-team/bind-dyndb-ldap][master] 11 commits: Skip isc_bind9 check on BIND 9.16.17+
Timo Aaltonen (@tjaalton)
gitlab at salsa.debian.org
Wed Jun 22 19:26:13 BST 2022
Timo Aaltonen pushed to branch master at FreeIPA packaging / bind-dyndb-ldap
Commits:
d7d3032d by Petr Menšík at 2021-06-17T17:57:52+02:00
Skip isc_bind9 check on BIND 9.16.17+
Reference variable refvar from dns_dyndbctx_t were removed. Removed was
also flag requesting different namespace. Skip that check on last stable
version, it should eval to false on all versions anyway.
- - - - -
056d2e2b by Petr Menšík at 2022-01-30T21:10:13+01:00
Initial support for BIND 9.18 support
Some changes needed to build with the most recent BIND9 release. It does
not yet provide complete support for new release.
Detects version of libdns just from libdns.so symlink. It requires
--libdir= explicitly set for this part to work.
- - - - -
7206aba2 by Petr Menšík at 2022-02-22T17:09:36+01:00
Add basic support of dns_ssuruletype_t
dns_ssutable_addrule changed input types. Add very basic support for the
new type, without support for parsing actual rule string including max
count.
- - - - -
d28f8ef1 by Petr Menšík at 2022-02-22T17:52:07+01:00
Support for 9.18 and 9.17 support
Make dns_name_copynf alias to support both older and more recent
release. Initialize few other variables to pass new compiler warnings.
Remove few changed functions in database interface.
- - - - -
fa16da22 by Petr Menšík at 2022-02-24T01:51:39+01:00
Move common dns_name_copynf compatibility macros to header
The same dns_name_copynf is required in multiple places. Because I have
already modified util.h to require dyndb-config.h, it can contain also
these compatibility defines in single place.
Signed-off-by: Petr Menšík <pemensik at redhat.com>
- - - - -
f71746a0 by Alexander Bokovoy at 2022-06-21T10:02:27+03:00
Release 11.10
Support BIND 9.17+
Signed-off-by: Alexander Bokovoy <abokovoy at redhat.com>
- - - - -
4f82f26f by Timo Aaltonen at 2022-06-22T13:22:45+03:00
Merge branch 'upstream'
- - - - -
0793b3a3 by Timo Aaltonen at 2022-06-22T13:24:36+03:00
version bump
- - - - -
644b8325 by Timo Aaltonen at 2022-06-22T13:33:40+03:00
patches: Drop upstreamed patches.
- - - - -
452b5dfc by Timo Aaltonen at 2022-06-22T14:52:59+03:00
rules: Don't force the libdir to /usr/lib.
Named can find plugins from the plugin dir without specifying the full path.
- - - - -
0ce3c7f8 by Timo Aaltonen at 2022-06-22T18:08:39+03:00
releasing package bind-dyndb-ldap version 11.10-1
- - - - -
19 changed files:
- configure.ac
- contrib/bind-dyndb-ldap.spec
- debian/bind9-dyndb-ldap.install
- debian/bind9-dyndb-ldap.postinst
- debian/changelog
- − debian/patches/0001-Skip-isc_bind9-check-on-BIND-9.16.17.patch
- debian/patches/series
- − debian/patches/support-9.18.diff
- debian/rules
- src/acl.c
- src/empty_zones.c
- src/ldap_convert.c
- src/ldap_driver.c
- src/ldap_helper.c
- src/mldap.c
- src/str.h
- src/syncptr.c
- src/syncrepl.c
- src/util.h
Changes:
=====================================
configure.ac
=====================================
@@ -1,5 +1,5 @@
AC_PREREQ([2.59])
-AC_INIT([bind-dyndb-ldap], [11.9], [freeipa-devel at redhat.com])
+AC_INIT([bind-dyndb-ldap], [11.10], [freeipa-devel at redhat.com])
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
@@ -53,6 +53,18 @@ AC_TRY_COMPILE([
[CFLAGS="$SAVED_CFLAGS"
AC_MSG_RESULT([no])])
+# Check if build chain supports -std=gnu11
+AC_MSG_CHECKING([for -std=gnu11 compiler flag])
+SAVED_CFLAGS="$CFLAGS"
+CFLAGS="-std=gnu11 -Werror"
+AC_TRY_COMPILE([
+ extern int fdef(void);
+],[],
+[AC_MSG_RESULT([yes])
+ CFLAGS="$SAVED_CFLAGS -std=gnu11"],
+[CFLAGS="$SAVED_CFLAGS"
+ AC_MSG_RESULT([no])])
+
# Get CFLAGS from isc-config.sh
AC_ARG_VAR([BIND9_CFLAGS],
[C compiler flags for bind9, overriding isc-config.sh])
@@ -98,6 +110,7 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([
#include <dns/version.h>
],[ printf("%d\n", dns_libinterface) ])], [
LIBDNS_VERSION_MAJOR=`./conftest$ac_exeext`
+ AC_MSG_RESULT([$LIBDNS_VERSION_MAJOR])
AC_DEFINE_UNQUOTED([LIBDNS_VERSION_MAJOR], [$LIBDNS_VERSION_MAJOR],
[Define libdns version])], [
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
@@ -111,9 +124,24 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([
return !(scanned == 3 && major == 9);
]])], [
LIBDNS_VERSION_MAJOR=`./conftest$ac_exeext`
+ AC_MSG_RESULT([$LIBDNS_VERSION_MAJOR])
AC_DEFINE_UNQUOTED([LIBDNS_VERSION_MAJOR], [$LIBDNS_VERSION_MAJOR],
[Define libdns version])],
- [AC_MSG_ERROR([Can't obtain libdns version.])])
+ [
+ LIBDNS_PATH="${libdir}/libdns.so"
+ if test -L "$LIBDNS_PATH" ; then
+ LIBDNS_VERSION_MAJOR=$(ls -l "$LIBDNS_PATH" | sed -e 's/^.*->\s*libdns-9\.\([[0-9]]\+\)\.\([[0-9]]\+\).*\.so/\1 \2/' -e t -e d | xargs printf "%02d%02d")
+ else
+ AC_MSG_ERROR([Can't obtain libdns version1.])
+ fi
+ if test -z "$LIBDNS_VERSION_MAJOR" || test "$LIBDNS_VERSION_MAJOR" -lt 1200; then
+ AC_MSG_ERROR([Can't obtain libdns version ($LIBDNS_VERSION_MAJOR).])
+ else
+ AC_DEFINE_UNQUOTED([LIBDNS_VERSION_MAJOR], [$LIBDNS_VERSION_MAJOR],
+ [Define libdns version])
+ AC_MSG_RESULT([$LIBDNS_VERSION_MAJOR])
+ fi
+ ])
], [AC_MSG_ERROR([Cross compiling is not supported.])]
)
@@ -137,6 +165,10 @@ AC_CHECK_LIB([dns], [dns_db_setservestalettl],
[AC_DEFINE([HAVE_DNS_SERVESTALE], 1, [Define if dns library provides dns_db_setservestalettl])]
)
+AC_CHECK_LIB([dns], [dns_result_totext],
+ [AC_DEFINE([HAVE_DNS_RESULT_TOTEXT], 1, [Define if dns library provides dns_result_totext])]
+)
+
dnl Older autoconf (2.59, for example) doesn't define docdir
[[ ! -n "$docdir" ]] && docdir='${datadir}/doc/${PACKAGE_TARNAME}'
AC_SUBST([docdir])
=====================================
contrib/bind-dyndb-ldap.spec
=====================================
@@ -3,7 +3,7 @@
%define bind_version 32:9.11.17-1
Name: bind-dyndb-ldap
-Version: 11.9
+Version: 11.10
Release: 0%{?dist}
Summary: LDAP back-end plug-in for BIND
@@ -116,6 +116,10 @@ rm -rf %{buildroot}
%changelog
+* Tue Jun 21 2022 Alexander Bokovoy <abokovoy at redhat.com>
+- Release 11.10
+- Support BIND 9.17+
+
* Tue May 25 2021 Alexander Bokovoy <abokovoy at redhat.com>
- Release 11.9
- Support 9.16.16+
=====================================
debian/bind9-dyndb-ldap.install
=====================================
@@ -1,2 +1,2 @@
-usr/lib/bind
+usr/lib/*/bind
usr/share/doc/
=====================================
debian/bind9-dyndb-ldap.postinst
=====================================
@@ -3,27 +3,15 @@ set -e
fix_named_conf() {
# The following sed script:
- # - scopes the named.conf changes to dynamic-db
- # - replaces arg "name value" syntax with name "value"
- # - changes dynamic-db header to dyndb
+ # - scopes the named.conf changes to dyndb
# - uses the new way the define path to the library
- # - removes no longer supported arguments (library, cache_ttl,
- # psearch, serial_autoincrement, zone_refresh)
while read -r PATTERN
do
SEDSCRIPT+="$PATTERN"
done <<EOF
-/^\s*dynamic-db/,/};/ {
- s/\(\s*\)arg\s\+\(["']\)\([a-zA-Z_]\+\s\)/\1\3\2/g;
- s/^dynamic-db/dyndb/;
- s@\(dyndb "[^"]\+"\)@\1 "/usr/lib/bind/ldap.so"@;
- s@\(dyndb '[^']\+'\)@\1 '/usr/lib/bind/ldap.so'@;
- /\s*library[^;]\+;/d;
- /\s*cache_ttl[^;]\+;/d;
- /\s*psearch[^;]\+;/d;
- /\s*serial_autoincrement[^;]\+;/d;
- /\s*zone_refresh[^;]\+;/d;
+/^\s*dyndb/,/};/ {
+ s/\/usr\/lib\/bind\///;
}
EOF
sed -i.bak -e "$SEDSCRIPT" /etc/bind/named.conf
@@ -33,7 +21,7 @@ if [ $1 = "configure" ]; then
chown root:bind /var/cache/bind/dynamic /var/cache/bind/dyndb-ldap
chmod 0770 /var/cache/bind/dynamic /var/cache/bind/dyndb-ldap
- if dpkg --compare-versions "$2" lt "11.1-4"; then
+ if dpkg --compare-versions "$2" lt "11.10-1"; then
fix_named_conf
fi
fi
=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+bind-dyndb-ldap (11.10-1) unstable; urgency=medium
+
+ * New upstream release.
+ * patches: Drop upstreamed patches.
+ * rules: Don't force the libdir to /usr/lib. Named can find plugins
+ from the plugin dir without specifying the full path.
+
+ -- Timo Aaltonen <tjaalton at debian.org> Wed, 22 Jun 2022 17:37:46 +0300
+
bind-dyndb-ldap (11.9-5) unstable; urgency=medium
* support-9.18.diff: Fix build with bind9 9.18. (Closes: #1006014)
=====================================
debian/patches/0001-Skip-isc_bind9-check-on-BIND-9.16.17.patch deleted
=====================================
@@ -1,35 +0,0 @@
-From d7d3032de7f5d3dd3cffea6064549b63a9ad7d59 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik at redhat.com>
-Date: Thu, 17 Jun 2021 17:57:52 +0200
-Subject: [PATCH] Skip isc_bind9 check on BIND 9.16.17+
-
-Reference variable refvar from dns_dyndbctx_t were removed. Removed was
-also flag requesting different namespace. Skip that check on last stable
-version, it should eval to false on all versions anyway.
----
- src/ldap_driver.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/ldap_driver.c b/src/ldap_driver.c
-index e9f1005..5f9e00a 100644
---- a/src/ldap_driver.c
-+++ b/src/ldap_driver.c
-@@ -1156,6 +1156,7 @@ dyndb_init(isc_mem_t *mctx, const char *name, const char *parameters,
- RUNTIME_CHECK(isc_once_do(&library_init_once, library_init)
- == ISC_R_SUCCESS);
-
-+#if LIBDNS_VERSION_MAJOR < 1617
- /*
- * Depending on how dlopen() was called, we may not have
- * access to named's global namespace, in which case we need
-@@ -1168,6 +1169,7 @@ dyndb_init(isc_mem_t *mctx, const char *name, const char *parameters,
- isc_hash_set_initializer(dctx->hashinit);
- log_debug(5, "registering library from dynamic ldap driver, %p != %p.", dctx->refvar, &isc_bind9);
- }
-+#endif
-
- log_debug(2, "registering dynamic ldap driver for %s.", name);
-
---
-2.32.0
-
=====================================
debian/patches/series
=====================================
@@ -1,5 +1,3 @@
-support-9.18.diff
fix-keytab-path.diff
fix-werror-build.diff
-0001-Skip-isc_bind9-check-on-BIND-9.16.17.patch
hardcode-version.diff
=====================================
debian/patches/support-9.18.diff deleted
=====================================
@@ -1,418 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index faac214..e5ab91d 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -53,6 +53,18 @@ AC_TRY_COMPILE([
- [CFLAGS="$SAVED_CFLAGS"
- AC_MSG_RESULT([no])])
-
-+# Check if build chain supports -std=gnu11
-+AC_MSG_CHECKING([for -std=gnu11 compiler flag])
-+SAVED_CFLAGS="$CFLAGS"
-+CFLAGS="-std=gnu11 -Werror"
-+AC_TRY_COMPILE([
-+ extern int fdef(void);
-+],[],
-+[AC_MSG_RESULT([yes])
-+ CFLAGS="$SAVED_CFLAGS -std=gnu11"],
-+[CFLAGS="$SAVED_CFLAGS"
-+ AC_MSG_RESULT([no])])
-+
- # Get CFLAGS from isc-config.sh
- AC_ARG_VAR([BIND9_CFLAGS],
- [C compiler flags for bind9, overriding isc-config.sh])
-@@ -98,6 +110,7 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([
- #include <dns/version.h>
- ],[ printf("%d\n", dns_libinterface) ])], [
- LIBDNS_VERSION_MAJOR=`./conftest$ac_exeext`
-+ AC_MSG_RESULT([$LIBDNS_VERSION_MAJOR])
- AC_DEFINE_UNQUOTED([LIBDNS_VERSION_MAJOR], [$LIBDNS_VERSION_MAJOR],
- [Define libdns version])], [
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-@@ -111,9 +124,24 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([
- return !(scanned == 3 && major == 9);
- ]])], [
- LIBDNS_VERSION_MAJOR=`./conftest$ac_exeext`
-+ AC_MSG_RESULT([$LIBDNS_VERSION_MAJOR])
- AC_DEFINE_UNQUOTED([LIBDNS_VERSION_MAJOR], [$LIBDNS_VERSION_MAJOR],
- [Define libdns version])],
-- [AC_MSG_ERROR([Can't obtain libdns version.])])
-+ [
-+ LIBDNS_PATH="${libdir}/libdns.so"
-+ if test -L "$LIBDNS_PATH" ; then
-+ LIBDNS_VERSION_MAJOR=$(ls -l "$LIBDNS_PATH" | sed -e 's/^.*->\s*libdns-9\.\([[0-9]]\+\)\.\([[0-9]]\+\).*\.so/\1 \2/' -e t -e d | xargs printf "%02d%02d")
-+ else
-+ AC_MSG_ERROR([Can't obtain libdns version1.])
-+ fi
-+ if test -z "$LIBDNS_VERSION_MAJOR" || test "$LIBDNS_VERSION_MAJOR" -lt 1200; then
-+ AC_MSG_ERROR([Can't obtain libdns version ($LIBDNS_VERSION_MAJOR).])
-+ else
-+ AC_DEFINE_UNQUOTED([LIBDNS_VERSION_MAJOR], [$LIBDNS_VERSION_MAJOR],
-+ [Define libdns version])
-+ AC_MSG_RESULT([$LIBDNS_VERSION_MAJOR])
-+ fi
-+ ])
- ], [AC_MSG_ERROR([Cross compiling is not supported.])]
- )
-
-@@ -137,6 +165,10 @@ AC_CHECK_LIB([dns], [dns_db_setservestalettl],
- [AC_DEFINE([HAVE_DNS_SERVESTALE], 1, [Define if dns library provides dns_db_setservestalettl])]
- )
-
-+AC_CHECK_LIB([dns], [dns_result_totext],
-+ [AC_DEFINE([HAVE_DNS_RESULT_TOTEXT], 1, [Define if dns library provides dns_result_totext])]
-+)
-+
- dnl Older autoconf (2.59, for example) doesn't define docdir
- [[ ! -n "$docdir" ]] && docdir='${datadir}/doc/${PACKAGE_TARNAME}'
- AC_SUBST([docdir])
-diff --git a/src/acl.c b/src/acl.c
-index ba89abc..8f5f33f 100644
---- a/src/acl.c
-+++ b/src/acl.c
-@@ -66,6 +66,10 @@ const enum_txt_assoc_t acl_type_txts[] = {
- } \
- } while (0)
-
-+#if LIBDNS_VERSION_MAJOR < 1700
-+typedef dns_rdatatype_t dns_ssuruletype_t;
-+#endif
-+
- static isc_result_t ATTR_NONNULLS ATTR_CHECKRESULT
- get_mode(const cfg_obj_t *obj, bool *value)
- {
-@@ -184,14 +188,14 @@ count_list_elements(const cfg_obj_t *list)
- }
-
- static isc_result_t ATTR_NONNULLS ATTR_CHECKRESULT
--get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_rdatatype_t **typesp,
-+get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_ssuruletype_t **typesp,
- unsigned int *np)
- {
- isc_result_t result = ISC_R_SUCCESS;
- unsigned int i;
- unsigned int n = 0;
- const cfg_listelt_t *el;
-- dns_rdatatype_t *types = NULL;
-+ dns_ssuruletype_t *types = NULL;
-
- REQUIRE(obj != NULL);
- REQUIRE(typesp != NULL && *typesp == NULL);
-@@ -201,7 +205,7 @@ get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_rdatatype_t **typesp,
-
- n = count_list_elements(obj);
- if (n > 0) {
-- types = isc_mem_get(mctx, n * sizeof(dns_rdatatype_t));
-+ types = isc_mem_get(mctx, n * sizeof(dns_ssuruletype_t));
- }
- i = 0;
- for (el = cfg_list_first(obj); el != NULL; el = cfg_list_next(el)) {
-@@ -216,7 +220,12 @@ get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_rdatatype_t **typesp,
- DE_CONST(str, r.base);
- r.length = strlen(str);
-
-+#if LIBDNS_VERSION_MAJOR < 1700
- result = dns_rdatatype_fromtext(&types[i++], &r);
-+#else
-+ types[i].max = 0;
-+ result = dns_rdatatype_fromtext(&types[i++].type, &r);
-+#endif
- if (result != ISC_R_SUCCESS) {
- log_error("'%s' is not a valid type", str);
- goto cleanup;
-@@ -229,7 +238,7 @@ get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_rdatatype_t **typesp,
- return result;
-
- cleanup:
-- SAFE_MEM_PUT(mctx, types, n * sizeof(dns_rdatatype_t));
-+ SAFE_MEM_PUT(mctx, types, n * sizeof(dns_ssuruletype_t));
-
- return result;
- }
-@@ -281,14 +290,18 @@ acl_configure_zone_ssutable(const char *policy_str, dns_zone_t *zone)
- goto cleanup;
- }
-
-+#if LIBDNS_VERSION_MAJOR >= 1700
-+ dns_ssutable_create(mctx, &table);
-+#else
- CHECK(dns_ssutable_create(mctx, &table));
-+#endif
-
- for (el = cfg_list_first(policy); el != NULL; el = cfg_list_next(el)) {
- const cfg_obj_t *stmt;
- bool grant;
- unsigned int match_type;
- dns_fixedname_t fname, fident;
-- dns_rdatatype_t *types;
-+ dns_ssuruletype_t *types;
- unsigned int n;
-
- types = NULL;
-@@ -303,9 +316,14 @@ acl_configure_zone_ssutable(const char *policy_str, dns_zone_t *zone)
- result = get_fixed_name(stmt, "name", &fname);
- if (result == ISC_R_NOTFOUND &&
- match_type == dns_ssumatchtype_subdomain) {
-+#if LIBDNS_VERSION_MAJOR >= 1700
-+ dns_name_copy(dns_zone_getorigin(zone),
-+ dns_fixedname_initname(&fname));
-+#else
- CHECK(dns_name_copy(dns_zone_getorigin(zone),
- dns_fixedname_initname(&fname),
- &fname.buffer));
-+#endif
- }
- else if (result != ISC_R_SUCCESS)
- goto cleanup;
-@@ -324,13 +342,22 @@ acl_configure_zone_ssutable(const char *policy_str, dns_zone_t *zone)
- CLEANUP_WITH(DNS_R_BADNAME);
- }
-
-+#if LIBDNS_VERSION_MAJOR >= 1700
-+ result = ISC_R_SUCCESS;
-+ dns_ssutable_addrule(table, grant,
-+ dns_fixedname_name(&fident),
-+ match_type,
-+ dns_fixedname_name(&fname),
-+ n, types);
-+#else
- result = dns_ssutable_addrule(table, grant,
- dns_fixedname_name(&fident),
- match_type,
- dns_fixedname_name(&fname),
- n, types);
-+#endif
-
-- SAFE_MEM_PUT(mctx, types, n * sizeof(dns_rdatatype_t));
-+ SAFE_MEM_PUT(mctx, types, n * sizeof(dns_ssuruletype_t));
- if (result != ISC_R_SUCCESS)
- goto cleanup;
-
-diff --git a/src/empty_zones.c b/src/empty_zones.c
-index e3e4545..03f16fc 100644
---- a/src/empty_zones.c
-+++ b/src/empty_zones.c
-@@ -15,6 +15,8 @@
-
- #if LIBDNS_VERSION_MAJOR < 1600
- #define dns_name_copynf(src, dst) dns_name_copy((src), (dst), NULL)
-+#elif LIBDNS_VERSION_MAJOR >= 1714
-+#define dns_name_copynf(src, dst) dns_name_copy((src), (dst))
- #endif
-
- /**
-diff --git a/src/ldap_convert.c b/src/ldap_convert.c
-index dc6e32b..f8e4fba 100644
---- a/src/ldap_convert.c
-+++ b/src/ldap_convert.c
-@@ -29,6 +29,8 @@
-
- #if LIBDNS_VERSION_MAJOR < 1600
- #define dns_name_copynf(src, dst) dns_name_copy((src), (dst), NULL)
-+#elif LIBDNS_VERSION_MAJOR >= 1714
-+#define dns_name_copynf(src, dst) dns_name_copy((src), (dst))
- #endif
-
- /**
-diff --git a/src/ldap_driver.c b/src/ldap_driver.c
-index e9f1005..a8f01b6 100644
---- a/src/ldap_driver.c
-+++ b/src/ldap_driver.c
-@@ -11,11 +11,13 @@
- #include <isc/buffer.h>
- #include <isc/commandline.h>
- #include <isc/hash.h>
--#include <isc/lib.h>
- #include <isc/mem.h>
- #include <isc/once.h>
- #include <isc/refcount.h>
- #include <isc/util.h>
-+#if LIBDNS_VERSION_MAJOR < 1617
-+#include <isc/lib.h>
-+#endif
-
- #include <dns/db.h>
- #include <dns/diff.h>
-@@ -238,6 +240,7 @@ endload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
- return ISC_R_SUCCESS;
- }
-
-+#if LIBDNS_VERSION_MAJOR < 1719
- static isc_result_t
- serialize(dns_db_t *db, dns_dbversion_t *version, FILE *file)
- {
-@@ -247,6 +250,7 @@ serialize(dns_db_t *db, dns_dbversion_t *version, FILE *file)
-
- return dns_db_serialize(ldapdb->rbtdb, version, file);
- }
-+#endif
-
- /* !!! This could be required for optimizations (like on-disk cache). */
- static isc_result_t
-@@ -635,6 +639,7 @@ issecure(dns_db_t *db)
- return dns_db_issecure(ldapdb->rbtdb);
- }
-
-+#if LIBDNS_VERSION_MAJOR < 1721
- static unsigned int
- nodecount(dns_db_t *db)
- {
-@@ -644,6 +649,17 @@ nodecount(dns_db_t *db)
-
- return dns_db_nodecount(ldapdb->rbtdb);
- }
-+#else
-+static unsigned int
-+nodecount(dns_db_t *db, dns_dbtree_t tree)
-+{
-+ ldapdb_t *ldapdb = (ldapdb_t *) db;
-+
-+ REQUIRE(VALID_LDAPDB(ldapdb));
-+
-+ return dns_db_nodecount(ldapdb->rbtdb, tree);
-+}
-+#endif
-
- /**
- * Return TRUE, because database does not need to be loaded from disk
-@@ -896,7 +912,7 @@ getservestalettl(dns_db_t *db, dns_ttl_t *ttl) {
- }
- #endif
-
--#if LIBDNS_VERSION_MAJOR >= 1606
-+#if LIBDNS_VERSION_MAJOR >= 1606 && LIBDNS_VERSION_MAJOR < 1720
- /* Used for cache size adjustments, called by dns_cache_setcachesize.
- * Just proxy to rbtdb implementation. */
- static isc_result_t
-@@ -914,7 +930,9 @@ static dns_dbmethods_t ldapdb_methods = {
- detach,
- beginload,
- endload,
-+#if LIBDNS_VERSION_MAJOR < 1719
- serialize, /* see dns_db_serialize(), implementation is not mandatory */
-+#endif
- dump,
- currentversion,
- newversion,
-@@ -966,7 +984,7 @@ static dns_dbmethods_t ldapdb_methods = {
- #if LIBDNS_VERSION_MAJOR >= 1600
- NULL, /* setgluecachestats */
- #endif
--#if LIBDNS_VERSION_MAJOR >= 1606
-+#if LIBDNS_VERSION_MAJOR >= 1606 && LIBDNS_VERSION_MAJOR < 1720
- adjusthashsize, /* adjusthashsize */
- #endif
- };
-diff --git a/src/ldap_helper.c b/src/ldap_helper.c
-index 97a1859..7ea3df9 100644
---- a/src/ldap_helper.c
-+++ b/src/ldap_helper.c
-@@ -5,6 +5,7 @@
- #include "dyndb-config.h"
- #define HAVE_TLS 1
- #define HAVE_THREAD_LOCAL 1
-+#include <threads.h>
-
- #include <dns/dyndb.h>
- #include <dns/diff.h>
-@@ -3760,7 +3761,7 @@ static void ATTR_NONNULLS
- update_zone(isc_task_t *task, isc_event_t *event)
- {
- ldap_syncreplevent_t *pevent = (ldap_syncreplevent_t *)event;
-- isc_result_t result ;
-+ isc_result_t result = ISC_R_SUCCESS;
- ldap_instance_t *inst = pevent->inst;
- isc_mem_t *mctx;
- dns_name_t prevname;
-diff --git a/src/mldap.c b/src/mldap.c
-index 3a76153..2c41d5d 100644
---- a/src/mldap.c
-+++ b/src/mldap.c
-@@ -44,6 +44,9 @@
- #else
- /* BIND 9.16+ */
- #define REFCOUNT_CAST(n) ((isc_refcount_t) (n))
-+#if LIBDNS_VERSION_MAJOR >= 1714
-+#define dns_name_copynf(src, dst) dns_name_copy((src), (dst))
-+#endif
- #endif
-
- /* name "ldap.uuid." */
-@@ -495,7 +498,7 @@ mldap_iter_deadnodes_next(mldapdb_t *mldap, metadb_iter_t **iterp,
- isc_result_t result;
- dns_dbnode_t *rbt_node = NULL;
- metadb_iter_t *iter = NULL;
-- uint32_t node_generation;
-+ uint32_t node_generation = 0;
- uint32_t cur_generation;
- metadb_node_t metadb_node;
- DECLARE_BUFFERED_NAME(name);
-diff --git a/src/str.h b/src/str.h
-index a4061c0..e716361 100644
---- a/src/str.h
-+++ b/src/str.h
-@@ -17,7 +17,7 @@
- #define _STR_MEM_FLARG_PASS , file, line
- #else
- #define _STR_MEM_FILELINE
--#define _STR_MEM_FLAG
-+#define _STR_MEM_FLARG
- #define _STR_MEM_FLARG_PASS
- #endif
-
-diff --git a/src/syncptr.c b/src/syncptr.c
-index 8824679..7d6047d 100644
---- a/src/syncptr.c
-+++ b/src/syncptr.c
-@@ -34,6 +34,8 @@
-
- #if LIBDNS_VERSION_MAJOR < 1600
- #define dns_name_copynf(src, dst) dns_name_copy((src), (dst), NULL)
-+#elif LIBDNS_VERSION_MAJOR >= 1714
-+#define dns_name_copynf(src, dst) dns_name_copy((src), (dst))
- #endif
-
- /*
-diff --git a/src/syncrepl.c b/src/syncrepl.c
-index 3baeb78..0bee09a 100644
---- a/src/syncrepl.c
-+++ b/src/syncrepl.c
-@@ -129,7 +129,7 @@ void
- finish(isc_task_t *task, isc_event_t *event) {
- isc_result_t result = ISC_R_SUCCESS;
- sync_barrierev_t *bev = NULL;
-- sync_state_t new_state;
-+ sync_state_t new_state = sync_configinit;
-
- REQUIRE(event != NULL);
- UNUSED(task);
-@@ -496,8 +496,8 @@ isc_result_t
- sync_barrier_wait(sync_ctx_t *sctx, ldap_instance_t *inst) {
- isc_event_t *ev = NULL;
- sync_barrierev_t *bev = NULL;
-- sync_state_t barrier_state;
-- sync_state_t final_state;
-+ sync_state_t barrier_state = sync_configinit;
-+ sync_state_t final_state = sync_configinit;
- task_element_t *taskel = NULL;
- task_element_t *next_taskel = NULL;
-
-diff --git a/src/util.h b/src/util.h
-index 7a8555b..f4b08f9 100644
---- a/src/util.h
-+++ b/src/util.h
-@@ -15,9 +15,14 @@
- #include <dns/result.h>
-
- #include "log.h"
-+#include "dyndb-config.h"
-
- extern bool verbose_checks; /* from settings.c */
-
-+#ifndef HAVE_DNS_RESULT_TOTEXT
-+#define dns_result_totext isc_result_totext
-+#endif
-+
- #define CLEANUP_WITH(result_code) \
- do { \
- result = (result_code); \
=====================================
debian/rules
=====================================
@@ -8,7 +8,6 @@ BIND9_LIBS_VER = $(shell dpkg-query -f='$${Version}\n' -W bind9-libs)
override_dh_auto_configure:
dh_auto_configure -- \
- --libdir=/usr/lib \
--docdir=/usr/share/doc/bind9-dyndb-ldap
override_dh_auto_install:
=====================================
src/acl.c
=====================================
@@ -66,6 +66,10 @@ const enum_txt_assoc_t acl_type_txts[] = {
} \
} while (0)
+#if LIBDNS_VERSION_MAJOR < 1700
+typedef dns_rdatatype_t dns_ssuruletype_t;
+#endif
+
static isc_result_t ATTR_NONNULLS ATTR_CHECKRESULT
get_mode(const cfg_obj_t *obj, bool *value)
{
@@ -184,14 +188,14 @@ count_list_elements(const cfg_obj_t *list)
}
static isc_result_t ATTR_NONNULLS ATTR_CHECKRESULT
-get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_rdatatype_t **typesp,
+get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_ssuruletype_t **typesp,
unsigned int *np)
{
isc_result_t result = ISC_R_SUCCESS;
unsigned int i;
unsigned int n = 0;
const cfg_listelt_t *el;
- dns_rdatatype_t *types = NULL;
+ dns_ssuruletype_t *types = NULL;
REQUIRE(obj != NULL);
REQUIRE(typesp != NULL && *typesp == NULL);
@@ -201,7 +205,7 @@ get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_rdatatype_t **typesp,
n = count_list_elements(obj);
if (n > 0) {
- types = isc_mem_get(mctx, n * sizeof(dns_rdatatype_t));
+ types = isc_mem_get(mctx, n * sizeof(dns_ssuruletype_t));
}
i = 0;
for (el = cfg_list_first(obj); el != NULL; el = cfg_list_next(el)) {
@@ -216,7 +220,12 @@ get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_rdatatype_t **typesp,
DE_CONST(str, r.base);
r.length = strlen(str);
+#if LIBDNS_VERSION_MAJOR < 1700
result = dns_rdatatype_fromtext(&types[i++], &r);
+#else
+ types[i].max = 0;
+ result = dns_rdatatype_fromtext(&types[i++].type, &r);
+#endif
if (result != ISC_R_SUCCESS) {
log_error("'%s' is not a valid type", str);
goto cleanup;
@@ -229,7 +238,7 @@ get_types(isc_mem_t *mctx, const cfg_obj_t *obj, dns_rdatatype_t **typesp,
return result;
cleanup:
- SAFE_MEM_PUT(mctx, types, n * sizeof(dns_rdatatype_t));
+ SAFE_MEM_PUT(mctx, types, n * sizeof(dns_ssuruletype_t));
return result;
}
@@ -281,14 +290,18 @@ acl_configure_zone_ssutable(const char *policy_str, dns_zone_t *zone)
goto cleanup;
}
+#if LIBDNS_VERSION_MAJOR >= 1700
+ dns_ssutable_create(mctx, &table);
+#else
CHECK(dns_ssutable_create(mctx, &table));
+#endif
for (el = cfg_list_first(policy); el != NULL; el = cfg_list_next(el)) {
const cfg_obj_t *stmt;
bool grant;
unsigned int match_type;
dns_fixedname_t fname, fident;
- dns_rdatatype_t *types;
+ dns_ssuruletype_t *types;
unsigned int n;
types = NULL;
@@ -303,9 +316,14 @@ acl_configure_zone_ssutable(const char *policy_str, dns_zone_t *zone)
result = get_fixed_name(stmt, "name", &fname);
if (result == ISC_R_NOTFOUND &&
match_type == dns_ssumatchtype_subdomain) {
+#if LIBDNS_VERSION_MAJOR >= 1700
+ dns_name_copy(dns_zone_getorigin(zone),
+ dns_fixedname_initname(&fname));
+#else
CHECK(dns_name_copy(dns_zone_getorigin(zone),
dns_fixedname_initname(&fname),
&fname.buffer));
+#endif
}
else if (result != ISC_R_SUCCESS)
goto cleanup;
@@ -324,13 +342,22 @@ acl_configure_zone_ssutable(const char *policy_str, dns_zone_t *zone)
CLEANUP_WITH(DNS_R_BADNAME);
}
+#if LIBDNS_VERSION_MAJOR >= 1700
+ result = ISC_R_SUCCESS;
+ dns_ssutable_addrule(table, grant,
+ dns_fixedname_name(&fident),
+ match_type,
+ dns_fixedname_name(&fname),
+ n, types);
+#else
result = dns_ssutable_addrule(table, grant,
dns_fixedname_name(&fident),
match_type,
dns_fixedname_name(&fname),
n, types);
+#endif
- SAFE_MEM_PUT(mctx, types, n * sizeof(dns_rdatatype_t));
+ SAFE_MEM_PUT(mctx, types, n * sizeof(dns_ssuruletype_t));
if (result != ISC_R_SUCCESS)
goto cleanup;
=====================================
src/empty_zones.c
=====================================
@@ -13,10 +13,6 @@
#include "util.h"
#include "zone_register.h"
-#if LIBDNS_VERSION_MAJOR < 1600
-#define dns_name_copynf(src, dst) dns_name_copy((src), (dst), NULL)
-#endif
-
/**
* These zones should not leak onto the Internet.
* The list matches BIND commit 8f20f6c9d7ce5a0f0af6ee4c5361832d97b1c5d4
=====================================
src/ldap_convert.c
=====================================
@@ -27,10 +27,6 @@
#include "util.h"
#include "zone_register.h"
-#if LIBDNS_VERSION_MAJOR < 1600
-#define dns_name_copynf(src, dst) dns_name_copy((src), (dst), NULL)
-#endif
-
/**
* Convert LDAP DN to absolute DNS names.
*
=====================================
src/ldap_driver.c
=====================================
@@ -11,11 +11,13 @@
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/hash.h>
-#include <isc/lib.h>
#include <isc/mem.h>
#include <isc/once.h>
#include <isc/refcount.h>
#include <isc/util.h>
+#if LIBDNS_VERSION_MAJOR < 1617
+#include <isc/lib.h>
+#endif
#include <dns/db.h>
#include <dns/diff.h>
@@ -238,6 +240,7 @@ endload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
return ISC_R_SUCCESS;
}
+#if LIBDNS_VERSION_MAJOR < 1719
static isc_result_t
serialize(dns_db_t *db, dns_dbversion_t *version, FILE *file)
{
@@ -247,6 +250,7 @@ serialize(dns_db_t *db, dns_dbversion_t *version, FILE *file)
return dns_db_serialize(ldapdb->rbtdb, version, file);
}
+#endif
/* !!! This could be required for optimizations (like on-disk cache). */
static isc_result_t
@@ -635,6 +639,7 @@ issecure(dns_db_t *db)
return dns_db_issecure(ldapdb->rbtdb);
}
+#if LIBDNS_VERSION_MAJOR < 1721
static unsigned int
nodecount(dns_db_t *db)
{
@@ -644,6 +649,17 @@ nodecount(dns_db_t *db)
return dns_db_nodecount(ldapdb->rbtdb);
}
+#else
+static unsigned int
+nodecount(dns_db_t *db, dns_dbtree_t tree)
+{
+ ldapdb_t *ldapdb = (ldapdb_t *) db;
+
+ REQUIRE(VALID_LDAPDB(ldapdb));
+
+ return dns_db_nodecount(ldapdb->rbtdb, tree);
+}
+#endif
/**
* Return TRUE, because database does not need to be loaded from disk
@@ -896,7 +912,7 @@ getservestalettl(dns_db_t *db, dns_ttl_t *ttl) {
}
#endif
-#if LIBDNS_VERSION_MAJOR >= 1606
+#if LIBDNS_VERSION_MAJOR >= 1606 && LIBDNS_VERSION_MAJOR < 1720
/* Used for cache size adjustments, called by dns_cache_setcachesize.
* Just proxy to rbtdb implementation. */
static isc_result_t
@@ -914,7 +930,9 @@ static dns_dbmethods_t ldapdb_methods = {
detach,
beginload,
endload,
+#if LIBDNS_VERSION_MAJOR < 1719
serialize, /* see dns_db_serialize(), implementation is not mandatory */
+#endif
dump,
currentversion,
newversion,
@@ -966,7 +984,7 @@ static dns_dbmethods_t ldapdb_methods = {
#if LIBDNS_VERSION_MAJOR >= 1600
NULL, /* setgluecachestats */
#endif
-#if LIBDNS_VERSION_MAJOR >= 1606
+#if LIBDNS_VERSION_MAJOR >= 1606 && LIBDNS_VERSION_MAJOR < 1720
adjusthashsize, /* adjusthashsize */
#endif
};
@@ -1156,6 +1174,7 @@ dyndb_init(isc_mem_t *mctx, const char *name, const char *parameters,
RUNTIME_CHECK(isc_once_do(&library_init_once, library_init)
== ISC_R_SUCCESS);
+#if LIBDNS_VERSION_MAJOR < 1617
/*
* Depending on how dlopen() was called, we may not have
* access to named's global namespace, in which case we need
@@ -1168,6 +1187,7 @@ dyndb_init(isc_mem_t *mctx, const char *name, const char *parameters,
isc_hash_set_initializer(dctx->hashinit);
log_debug(5, "registering library from dynamic ldap driver, %p != %p.", dctx->refvar, &isc_bind9);
}
+#endif
log_debug(2, "registering dynamic ldap driver for %s.", name);
=====================================
src/ldap_helper.c
=====================================
@@ -5,6 +5,7 @@
#include "dyndb-config.h"
#define HAVE_TLS 1
#define HAVE_THREAD_LOCAL 1
+#include <threads.h>
#include <dns/dyndb.h>
#include <dns/diff.h>
@@ -3760,7 +3761,7 @@ static void ATTR_NONNULLS
update_zone(isc_task_t *task, isc_event_t *event)
{
ldap_syncreplevent_t *pevent = (ldap_syncreplevent_t *)event;
- isc_result_t result ;
+ isc_result_t result = ISC_R_SUCCESS;
ldap_instance_t *inst = pevent->inst;
isc_mem_t *mctx;
dns_name_t prevname;
=====================================
src/mldap.c
=====================================
@@ -30,7 +30,6 @@
#include "dyndb-config.h"
#if LIBDNS_VERSION_MAJOR < 1600
-#define dns_name_copynf(src, dst) dns_name_copy((src), (dst), NULL)
#define REFCOUNT_CAST(n) ((typeof(((isc_refcount_t *)0)->refs)) (n))
/* Static assert is not provided yet, copy from 9.16 */
@@ -495,7 +494,7 @@ mldap_iter_deadnodes_next(mldapdb_t *mldap, metadb_iter_t **iterp,
isc_result_t result;
dns_dbnode_t *rbt_node = NULL;
metadb_iter_t *iter = NULL;
- uint32_t node_generation;
+ uint32_t node_generation = 0;
uint32_t cur_generation;
metadb_node_t metadb_node;
DECLARE_BUFFERED_NAME(name);
=====================================
src/str.h
=====================================
@@ -17,7 +17,7 @@
#define _STR_MEM_FLARG_PASS , file, line
#else
#define _STR_MEM_FILELINE
-#define _STR_MEM_FLAG
+#define _STR_MEM_FLARG
#define _STR_MEM_FLARG_PASS
#endif
=====================================
src/syncptr.c
=====================================
@@ -32,10 +32,6 @@
#define SYNCPTR_FMTPRE SYNCPTR_PREF "(%s) for '%s A/AAAA %s' "
#define SYNCPTR_FMTPOST ldap_modop_str(mod_op), a_name_str, ip_str
-#if LIBDNS_VERSION_MAJOR < 1600
-#define dns_name_copynf(src, dst) dns_name_copy((src), (dst), NULL)
-#endif
-
/*
* Event for asynchronous PTR record synchronization.
*/
=====================================
src/syncrepl.c
=====================================
@@ -129,7 +129,7 @@ void
finish(isc_task_t *task, isc_event_t *event) {
isc_result_t result = ISC_R_SUCCESS;
sync_barrierev_t *bev = NULL;
- sync_state_t new_state;
+ sync_state_t new_state = sync_configinit;
REQUIRE(event != NULL);
UNUSED(task);
@@ -496,8 +496,8 @@ isc_result_t
sync_barrier_wait(sync_ctx_t *sctx, ldap_instance_t *inst) {
isc_event_t *ev = NULL;
sync_barrierev_t *bev = NULL;
- sync_state_t barrier_state;
- sync_state_t final_state;
+ sync_state_t barrier_state = sync_configinit;
+ sync_state_t final_state = sync_configinit;
task_element_t *taskel = NULL;
task_element_t *next_taskel = NULL;
=====================================
src/util.h
=====================================
@@ -15,9 +15,20 @@
#include <dns/result.h>
#include "log.h"
+#include "dyndb-config.h"
extern bool verbose_checks; /* from settings.c */
+#ifndef HAVE_DNS_RESULT_TOTEXT
+#define dns_result_totext isc_result_totext
+#endif
+
+#if LIBDNS_VERSION_MAJOR < 1600
+#define dns_name_copynf(src, dst) dns_name_copy((src), (dst), NULL)
+#elif LIBDNS_VERSION_MAJOR >= 1714
+#define dns_name_copynf(src, dst) dns_name_copy((src), (dst))
+#endif
+
#define CLEANUP_WITH(result_code) \
do { \
result = (result_code); \
View it on GitLab: https://salsa.debian.org/freeipa-team/bind-dyndb-ldap/-/compare/203baba7ceb6bb42176d9551a87af7fb415519a2...0ce3c7f8279d179081d13f39259ee1ac374fcf7a
--
View it on GitLab: https://salsa.debian.org/freeipa-team/bind-dyndb-ldap/-/compare/203baba7ceb6bb42176d9551a87af7fb415519a2...0ce3c7f8279d179081d13f39259ee1ac374fcf7a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-freeipa-devel/attachments/20220622/e99d8484/attachment-0001.htm>
More information about the Pkg-freeipa-devel
mailing list