summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2014-10-20 16:32:42 +1100
committerAmitay Isaacs <amitay@samba.org>2014-10-25 05:42:19 +0200
commitfaa3423d1a26eb6103389b234add0f1e8d0dfc08 (patch)
tree7bb860dbd3de604841600f06a6d575045991af3f
parentaeb6ad8a9c2713c6c71a2ac4cd355dd1bda6cc51 (diff)
downloadsamba-faa3423d1a26eb6103389b234add0f1e8d0dfc08.tar.gz
samba-faa3423d1a26eb6103389b234add0f1e8d0dfc08.tar.xz
samba-faa3423d1a26eb6103389b234add0f1e8d0dfc08.zip
s4-dns: Add support for BIND 9.10
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Matthieu Patou <mat@matws.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Sat Oct 25 05:42:19 CEST 2014 on sn-devel-104
-rw-r--r--python/samba/provision/sambadns.py6
-rw-r--r--source4/dns_server/dlz_bind9.c19
-rw-r--r--source4/dns_server/wscript_build10
-rw-r--r--source4/setup/named.conf.dlz3
4 files changed, 36 insertions, 2 deletions
diff --git a/python/samba/provision/sambadns.py b/python/samba/provision/sambadns.py
index 1ab8f4e303..b5639324b4 100644
--- a/python/samba/provision/sambadns.py
+++ b/python/samba/provision/sambadns.py
@@ -921,10 +921,13 @@ def create_named_conf(paths, realm, dnsdomain, dns_backend, logger):
cwd='.').communicate()[0]
bind9_8 = '#'
bind9_9 = '#'
+ bind9_10 = '#'
if bind_info.upper().find('BIND 9.8') != -1:
bind9_8 = ''
elif bind_info.upper().find('BIND 9.9') != -1:
bind9_9 = ''
+ elif bind_info.upper().find('BIND 9.10') != -1:
+ bind9_10 = ''
elif bind_info.upper().find('BIND 9.7') != -1:
raise ProvisioningError("DLZ option incompatible with BIND 9.7.")
else:
@@ -933,7 +936,8 @@ def create_named_conf(paths, realm, dnsdomain, dns_backend, logger):
"NAMED_CONF": paths.namedconf,
"MODULESDIR" : samba.param.modules_dir(),
"BIND9_8" : bind9_8,
- "BIND9_9" : bind9_9
+ "BIND9_9" : bind9_9,
+ "BIND9_10" : bind9_10
})
diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 29788dc768..d43b40478a 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -792,7 +792,13 @@ 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 dlz_bind9_data *state = talloc_get_type_abort(dbdata, struct dlz_bind9_data);
return b9_find_zone_dn(state, name, NULL, NULL);
@@ -874,7 +880,9 @@ _PUBLIC_ isc_result_t dlz_lookup(const char *zone, const char *name,
_PUBLIC_ isc_result_t dlz_allowzonexfr(void *dbdata, const char *name, const char *client)
{
/* just say yes for all our zones for now */
- return dlz_findzonedb(dbdata, name);
+ struct dlz_bind9_data *state = talloc_get_type(
+ dbdata, struct dlz_bind9_data);
+ return b9_find_zone_dn(state, name, NULL, NULL);
}
/*
@@ -1116,7 +1124,12 @@ 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;
@@ -1187,7 +1200,11 @@ _PUBLIC_ isc_result_t dlz_configure(dns_view_t *view, void *dbdata)
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/wscript_build b/source4/dns_server/wscript_build
index a92ab67a40..803ca62e6f 100644
--- a/source4/dns_server/wscript_build
+++ b/source4/dns_server/wscript_build
@@ -37,6 +37,16 @@ bld.SAMBA_LIBRARY('dlz_bind9_9',
deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
enabled=bld.AD_DC_BUILD_IS_ENABLED())
+bld.SAMBA_LIBRARY('dlz_bind9_10',
+ source='dlz_bind9.c',
+ cflags='-DBIND_VERSION_9_10',
+ private_library=True,
+ link_name='modules/bind9/dlz_bind9_10.so',
+ realname='dlz_bind9_10.so',
+ install_path='${MODULESDIR}/bind9',
+ deps='samba-hostconfig samdb-common gensec popt dnsserver_common',
+ enabled=bld.AD_DC_BUILD_IS_ENABLED())
+
bld.SAMBA_LIBRARY('dlz_bind9_for_torture',
source='dlz_bind9.c',
cflags='-DBIND_VERSION_9_8',
diff --git a/source4/setup/named.conf.dlz b/source4/setup/named.conf.dlz
index 2b884e9718..460d2ca642 100644
--- a/source4/setup/named.conf.dlz
+++ b/source4/setup/named.conf.dlz
@@ -15,5 +15,8 @@ dlz "AD DNS Zone" {
# For BIND 9.9.x
${BIND9_9} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
+
+ # For BIND 9.10.x
+ ${BIND9_10} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_10.so";
};