]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dlz: remove support for ancient binds
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 23 Apr 2021 07:37:55 +0000 (19:37 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 17 May 2021 22:29:01 +0000 (22:29 +0000)
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 <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon May 17 22:29:01 UTC 2021 on sn-devel-184

source4/dns_server/dlz_bind9.c
source4/dns_server/dlz_minimal.h

index 6f729f46561f6a92dca7323df68dfb4784320fac..38fc15534beda58e17d17b842a6d17fd1532d4e8 100644 (file)
@@ -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);
index d991528d6adcaae8dd3e0e4dc1fbad98a09940ea..e2a142668101e8bcf2997291cc88fb4ad0cf0579 100644 (file)
 #include <stdbool.h>
 
 #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