From a204e42c2f84cb0930f6996880af4de85f5794ec Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 23 Apr 2021 19:37:55 +1200 Subject: [PATCH] dlz: remove support for ancient binds We no longer support versions of bind that have DLZ_DLOPEN_VERSION != 3, so we no longer need all these ifdefs. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Mon May 17 22:29:01 UTC 2021 on sn-devel-184 --- source4/dns_server/dlz_bind9.c | 17 ----------------- source4/dns_server/dlz_minimal.h | 32 +++----------------------------- 2 files changed, 3 insertions(+), 46 deletions(-) diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c index 6f729f46561..38fc15534be 100644 --- a/source4/dns_server/dlz_bind9.c +++ b/source4/dns_server/dlz_bind9.c @@ -955,13 +955,9 @@ static isc_result_t b9_find_name_dn(struct dlz_bind9_data *state, const char *na /* see if we handle a given zone */ -#if DLZ_DLOPEN_VERSION < 3 -_PUBLIC_ isc_result_t dlz_findzonedb(void *dbdata, const char *name) -#else _PUBLIC_ isc_result_t dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo) -#endif { struct timeval start = timeval_current(); struct dlz_bind9_data *state = talloc_get_type_abort(dbdata, struct dlz_bind9_data); @@ -1076,15 +1072,10 @@ static isc_result_t dlz_lookup_types(struct dlz_bind9_data *state, /* lookup one record */ -#if DLZ_DLOPEN_VERSION == 1 -_PUBLIC_ isc_result_t dlz_lookup(const char *zone, const char *name, - void *dbdata, dns_sdlzlookup_t *lookup) -#else _PUBLIC_ isc_result_t dlz_lookup(const char *zone, const char *name, void *dbdata, dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo) -#endif { struct dlz_bind9_data *state = talloc_get_type_abort(dbdata, struct dlz_bind9_data); isc_result_t result = ISC_R_SUCCESS; @@ -1444,12 +1435,8 @@ static bool b9_zone_exists(struct dlz_bind9_data *state, const char *name) /* configure a writeable zone */ -#if DLZ_DLOPEN_VERSION < 3 -_PUBLIC_ isc_result_t dlz_configure(dns_view_t *view, void *dbdata) -#else _PUBLIC_ isc_result_t dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata) -#endif { struct dlz_bind9_data *state = talloc_get_type_abort(dbdata, struct dlz_bind9_data); TALLOC_CTX *tmp_ctx; @@ -1520,11 +1507,7 @@ _PUBLIC_ isc_result_t dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, return ISC_R_NOMEMORY; } -#if DLZ_DLOPEN_VERSION < 3 - result = state->writeable_zone(view, zone); -#else result = state->writeable_zone(view, dlzdb, zone); -#endif if (result != ISC_R_SUCCESS) { state->log(ISC_LOG_ERROR, "samba_dlz: Failed to configure zone '%s'", zone); diff --git a/source4/dns_server/dlz_minimal.h b/source4/dns_server/dlz_minimal.h index d991528d6ad..e2a14266810 100644 --- a/source4/dns_server/dlz_minimal.h +++ b/source4/dns_server/dlz_minimal.h @@ -27,11 +27,9 @@ #include #if defined (BIND_VERSION_9_8) -# define DLZ_DLOPEN_VERSION 1 +# error Bind 9.8 is not supported! #elif defined (BIND_VERSION_9_9) -# define DLZ_DLOPEN_VERSION 2 -# define DNS_CLIENTINFO_VERSION 1 -# define ISC_BOOLEAN_AS_BOOL 0 +# error Bind 9.9 is not supported! #elif defined (BIND_VERSION_9_10) # define DLZ_DLOPEN_VERSION 3 # define DNS_CLIENTINFO_VERSION 1 @@ -58,9 +56,7 @@ #define ISC_BOOLEAN_AS_BOOL 1 #endif -#if DLZ_DLOPEN_VERSION > 1 # define DLZ_DLOPEN_AGE 0 -#endif typedef unsigned int isc_result_t; #if ISC_BOOLEAN_AS_BOOL == 1 @@ -111,7 +107,6 @@ typedef void *dns_sdlzallnodes_t; typedef void *dns_view_t; typedef void *dns_dlzdb_t; -#if DLZ_DLOPEN_VERSION > 1 /* * Method and type definitions needed for retrieval of client info * from the caller. @@ -172,7 +167,6 @@ typedef struct dns_clientinfomethods { #endif /* DNS_CLIENTINFO_VERSION */ -#endif /* DLZ_DLOPEN_VERSION > 1 */ /* * Method definitions for callbacks provided by the dlopen driver @@ -191,14 +185,10 @@ typedef isc_result_t dns_sdlz_putnamedrr_t(dns_sdlzallnodes_t *allnodes, dns_ttl_t ttl, const char *data); -#if DLZ_DLOPEN_VERSION < 3 -typedef isc_result_t dns_dlz_writeablezone_t(dns_view_t *view, - const char *zone_name); -#else /* DLZ_DLOPEN_VERSION >= 3 */ typedef isc_result_t dns_dlz_writeablezone_t(dns_view_t *view, dns_dlzdb_t *dlzdb, const char *zone_name); -#endif /* DLZ_DLOPEN_VERSION */ + /* * prototypes for the functions you can include in your module @@ -231,30 +221,19 @@ dlz_destroy(void *dbdata); /* * dlz_findzonedb is required for all DLZ external drivers */ -#if DLZ_DLOPEN_VERSION < 3 -isc_result_t -dlz_findzonedb(void *dbdata, const char *name); -#else /* DLZ_DLOPEN_VERSION >= 3 */ isc_result_t dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo); -#endif /* DLZ_DLOPEN_VERSION */ /* * dlz_lookup is required for all DLZ external drivers */ -#if DLZ_DLOPEN_VERSION == 1 -isc_result_t -dlz_lookup(const char *zone, const char *name, void *dbdata, - dns_sdlzlookup_t *lookup); -#else /* DLZ_DLOPEN_VERSION > 1 */ isc_result_t dlz_lookup(const char *zone, const char *name, void *dbdata, dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo); -#endif /* DLZ_DLOPEN_VERSION */ /* * dlz_authority() is optional if dlz_lookup() supplies @@ -296,13 +275,8 @@ dlz_closeversion(const char *zone, isc_boolean_t commit, void *dbdata, * dlz_configure() is optional, but must be supplied if you want to support * dynamic updates */ -#if DLZ_DLOPEN_VERSION < 3 -isc_result_t -dlz_configure(dns_view_t *view, void *dbdata); -#else /* DLZ_DLOPEN_VERSION >= 3 */ isc_result_t dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb, void *dbdata); -#endif /* DLZ_DLOPEN_VERSION */ /* * dlz_ssumatch() is optional, but must be supplied if you want to support -- 2.47.3