[SCM] Samba Shared Repository - branch v4-2-test updated
Karolin Seeger
kseeger at samba.org
Mon Nov 24 15:36:08 MST 2014
The branch, v4-2-test has been updated
via e1b2b08 s4-dns: dlz-bind: Add trailing '.' to all fqdn strings
via d2d6c49 s4-dns: Add support for BIND 9.10
via 6e7d183 s4-dns: Update dlz_minimal.h based on BIND release 9.10
via 3f8552a s4-dns: Check DLZ_DLOPEN_VERSION for different BIND versions
via 8ba5688 s4-dns: Update template variables, change BIND98 --> BIND9_8
via 943f2b6 samba: pass down size_t instead of int to add_string_to_array().
via 26f9bf1 lib/util: use size_t for add_string_to_array().
via 05d0f5f s3-proto: remove duplicate proto for add_string_to_array().
via 8e2765b dbwrap_ctdb: Pass on mutex flags to tdb_open
from d1b9915 pdb_tdb: Fix a TALLOC/SAFE_FREE mixup
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-2-test
- Log -----------------------------------------------------------------
commit e1b2b085954eb37c5c3770143e4df77db1c41928
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Nov 3 11:57:50 2014 +1100
s4-dns: dlz-bind: Add trailing '.' to all fqdn strings
BIND 9.10.x is strict when sending records via putrr and putnamedrr.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10620
Thanks to Guenter Kukkukk for identifying the problem and resolution.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Guenter Kukkukk <kukks at samba.org>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Fri Nov 21 06:14:55 CET 2014 on sn-devel-104
(cherry picked from commit b7f6b09a13daaa702aef5a0ab9f458521e4902b1)
Autobuild-User(v4-2-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-2-test): Mon Nov 24 23:35:13 CET 2014 on sn-devel-104
commit d2d6c4992a3d5e233fa6eadd8ed714df2b9b64c0
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Oct 20 16:32:42 2014 +1100
s4-dns: Add support for BIND 9.10
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Matthieu Patou <mat at matws.net>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Sat Oct 25 05:42:19 CEST 2014 on sn-devel-104
(cherry picked from commit faa3423d1a26eb6103389b234add0f1e8d0dfc08)
commit 6e7d18338a64b8e5d6e39909daf279bebbc2936c
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Oct 20 15:31:30 2014 +1100
s4-dns: Update dlz_minimal.h based on BIND release 9.10
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Matthieu Patou <mat at matws.net>
(cherry picked from commit aeb6ad8a9c2713c6c71a2ac4cd355dd1bda6cc51)
commit 3f8552a672215c7e4434192baff39eefffe16fc9
Author: Amitay Isaacs <amitay at gmail.com>
Date: Sun Oct 19 12:57:55 2014 +1100
s4-dns: Check DLZ_DLOPEN_VERSION for different BIND versions
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Matthieu Patou <mat at matws.net>
(cherry picked from commit 1e5c14548c8d03f66aaa908654c94f36a94455f2)
commit 8ba5688b1096f2df0ee93eedd665efe18e70f67d
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Oct 20 16:40:05 2014 +1100
s4-dns: Update template variables, change BIND98 --> BIND9_8
This makes it easier to add suport for BIND 9.10.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Matthieu Patou <mat at matws.net>
(cherry picked from commit 58334eb58ed2f11c6f212481b6be772d9f182810)
commit 943f2b68c92ad5ba36f5d0af327c0d9a0d147d80
Author: Günther Deschner <gd at samba.org>
Date: Fri Nov 14 14:12:26 2014 +0100
samba: pass down size_t instead of int to add_string_to_array().
Guenther
Signed-off-by: Günther Deschner <gd at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Autobuild-User(master): Günther Deschner <gd at samba.org>
Autobuild-Date(master): Mon Nov 17 19:53:22 CET 2014 on sn-devel-104
The last 3 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10942
cleanup add_string_to_array and usage
commit 26f9bf1fa4f207005fc2c26e85eeb7a091ce8a27
Author: Günther Deschner <gd at samba.org>
Date: Fri Nov 14 13:27:45 2014 +0100
lib/util: use size_t for add_string_to_array().
Guenther
Signed-off-by: Günther Deschner <gd at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 05d0f5f2c6774d699c0b9a98dc45efe70b489383
Author: Günther Deschner <gd at samba.org>
Date: Fri Nov 14 13:47:16 2014 +0100
s3-proto: remove duplicate proto for add_string_to_array().
Guenther
Signed-off-by: Günther Deschner <gd at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 8e2765bfce6353436b0185e2279c8ba7dae376ca
Author: Volker Lendecke <vl at samba.org>
Date: Thu Nov 6 11:59:34 2014 +0100
dbwrap_ctdb: Pass on mutex flags to tdb_open
Without this, ctdb can create a tdb file with mutex activated, but the
local tdb_open will not open the tdb due to strict flags checks whether
mutexes are possible.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10922
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Sun Nov 16 12:13:54 CET 2014 on sn-devel-104
(cherry picked from commit 1106ede280938d05325baa146bd524aa3568deaf)
-----------------------------------------------------------------------
Summary of changes:
lib/util/samba_util.h | 2 +-
lib/util/util_strlist.c | 2 +-
libcli/ldap/ldap_message.h | 2 +-
libgpo/gpext/gpext.c | 2 +-
python/samba/provision/sambadns.py | 16 +-
source3/include/proto.h | 3 -
source3/lib/dbwrap/dbwrap_ctdb.c | 3 +-
source3/lib/eventlog/eventlog.c | 2 +-
source3/libads/ldap.c | 2 +-
source3/libnet/libnet_join.c | 4 +-
source3/rpc_server/lsa/srv_lsa_nt.c | 2 +-
source3/rpc_server/netlogon/srv_netlog_nt.c | 2 +-
source3/rpc_server/spoolss/srv_spoolss_nt.c | 3 +-
source3/rpcclient/cmd_spoolss.c | 5 +-
source3/winbindd/winbindd_cm.c | 2 +-
source4/dns_server/dlz_bind9.c | 76 ++++++++--
source4/dns_server/dlz_minimal.h | 227 ++++++++++++++++++++--------
source4/dns_server/wscript_build | 10 ++
source4/setup/named.conf.dlz | 11 +-
source4/torture/dns/dlz_bind9.c | 24 +--
source4/torture/rpc/samba3rpc.c | 4 +-
source4/torture/rpc/samr.c | 2 +-
source4/torture/rpc/wkssvc.c | 10 +-
23 files changed, 292 insertions(+), 124 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 41b3fc8..8e03d00 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -253,7 +253,7 @@ _PUBLIC_ char *rfc1738_escape_part(TALLOC_CTX *mem_ctx, const char *url);
* number of elements in strings. It will be updated by this function.
*/
_PUBLIC_ bool add_string_to_array(TALLOC_CTX *mem_ctx,
- const char *str, const char ***strings, int *num);
+ const char *str, const char ***strings, size_t *num);
/**
varient of strcmp() that handles NULL ptrs
diff --git a/lib/util/util_strlist.c b/lib/util/util_strlist.c
index d0be917..ea6c8a3 100644
--- a/lib/util/util_strlist.c
+++ b/lib/util/util_strlist.c
@@ -453,7 +453,7 @@ _PUBLIC_ const char **str_list_append_const(const char **list1,
* number of elements in strings. It will be updated by this function.
*/
_PUBLIC_ bool add_string_to_array(TALLOC_CTX *mem_ctx,
- const char *str, const char ***strings, int *num)
+ const char *str, const char ***strings, size_t *num)
{
char *dup_str = talloc_strdup(mem_ctx, str);
diff --git a/libcli/ldap/ldap_message.h b/libcli/ldap/ldap_message.h
index 4385fe6..2f64881 100644
--- a/libcli/ldap/ldap_message.h
+++ b/libcli/ldap/ldap_message.h
@@ -104,7 +104,7 @@ struct ldap_SearchRequest {
uint32_t sizelimit;
bool attributesonly;
struct ldb_parse_tree *tree;
- int num_attributes;
+ size_t num_attributes;
const char * const *attributes;
};
diff --git a/libgpo/gpext/gpext.c b/libgpo/gpext/gpext.c
index 2afcfec..1320dad 100644
--- a/libgpo/gpext/gpext.c
+++ b/libgpo/gpext/gpext.c
@@ -524,7 +524,7 @@ static NTSTATUS gp_glob_ext_list(TALLOC_CTX *mem_ctx,
name[PTR_DIFF(p, dirent->d_name)] = 0;
if (!add_string_to_array(mem_ctx, name, ext_list,
- (int *)ext_list_len)) {
+ ext_list_len)) {
closedir(dir);
return NT_STATUS_NO_MEMORY;
}
diff --git a/python/samba/provision/sambadns.py b/python/samba/provision/sambadns.py
index 29224c8..b563932 100644
--- a/python/samba/provision/sambadns.py
+++ b/python/samba/provision/sambadns.py
@@ -919,12 +919,15 @@ def create_named_conf(paths, realm, dnsdomain, dns_backend, logger):
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
cwd='.').communicate()[0]
- bind98 = '#'
- bind99 = '#'
+ bind9_8 = '#'
+ bind9_9 = '#'
+ bind9_10 = '#'
if bind_info.upper().find('BIND 9.8') != -1:
- bind98 = ''
+ bind9_8 = ''
elif bind_info.upper().find('BIND 9.9') != -1:
- bind99 = ''
+ 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:
@@ -932,8 +935,9 @@ def create_named_conf(paths, realm, dnsdomain, dns_backend, logger):
setup_file(setup_path("named.conf.dlz"), paths.namedconf, {
"NAMED_CONF": paths.namedconf,
"MODULESDIR" : samba.param.modules_dir(),
- "BIND98" : bind98,
- "BIND99" : bind99
+ "BIND9_8" : bind9_8,
+ "BIND9_9" : bind9_9,
+ "BIND9_10" : bind9_10
})
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 70fa7f7..eed57ff 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -702,9 +702,6 @@ int ipstr_list_parse(const char *ipstr_list, struct ip_service **ip_list);
void ipstr_list_free(char* ipstr_list);
uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr);
uint64_t conv_str_size(const char * str);
-bool add_string_to_array(TALLOC_CTX *mem_ctx,
- const char *str, const char ***strings,
- int *num);
void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len,
size_t *bufsize, const char *fmt, ...);
int asprintf_strupper_m(char **strp, const char *fmt, ...);
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 2aee435..e6dcc0e 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1607,7 +1607,8 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
result->lock_order = lock_order;
/* only pass through specific flags */
- tdb_flags &= TDB_SEQNUM|TDB_VOLATILE;
+ tdb_flags &= TDB_SEQNUM|TDB_VOLATILE|
+ TDB_MUTEX_LOCKING|TDB_CLEAR_IF_FIRST;
/* honor permissions if user has specified O_CREAT */
if (open_flags & O_CREAT) {
diff --git a/source3/lib/eventlog/eventlog.c b/source3/lib/eventlog/eventlog.c
index 4c6767d..e290af2 100644
--- a/source3/lib/eventlog/eventlog.c
+++ b/source3/lib/eventlog/eventlog.c
@@ -581,7 +581,7 @@ bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb
}
} else if ( 0 == strncmp( start, "STR", stop - start ) ) {
size_t tmp_len;
- int num_of_strings;
+ size_t num_of_strings;
/* skip past initial ":" */
stop++;
/* now skip any other leading whitespace */
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 06b4895..b46f510 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -3288,7 +3288,7 @@ ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads,
if (!add_string_to_array(mem_ctx, dn,
(const char ***)ous,
- (int *)num_ous)) {
+ num_ous)) {
TALLOC_FREE(dn);
ads_msgfree(ads, res);
return ADS_ERROR(LDAP_NO_MEMORY);
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index e70e11a..187e524 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -423,7 +423,7 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
ok = ads_element_in_array(spn_array, num_spns, spn);
if (!ok) {
ok = add_string_to_array(spn_array, spn,
- &spn_array, (int *)&num_spns);
+ &spn_array, &num_spns);
if (!ok) {
return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
}
@@ -448,7 +448,7 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
ok = ads_element_in_array(spn_array, num_spns, spn);
if (!ok) {
ok = add_string_to_array(spn_array, spn,
- &spn_array, (int *)&num_spns);
+ &spn_array, &num_spns);
if (!ok) {
return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
}
diff --git a/source3/rpc_server/lsa/srv_lsa_nt.c b/source3/rpc_server/lsa/srv_lsa_nt.c
index 67909aa..039206b 100644
--- a/source3/rpc_server/lsa/srv_lsa_nt.c
+++ b/source3/rpc_server/lsa/srv_lsa_nt.c
@@ -3335,7 +3335,7 @@ static NTSTATUS init_lsa_right_set(TALLOC_CTX *mem_ctx,
uint32 i;
const char *privname;
const char **privname_array = NULL;
- int num_priv = 0;
+ size_t num_priv = 0;
for (i=0; i<privileges->count; i++) {
if (privileges->set[i].luid.high) {
diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c
index de30106..fdcc847 100644
--- a/source3/rpc_server/netlogon/srv_netlog_nt.c
+++ b/source3/rpc_server/netlogon/srv_netlog_nt.c
@@ -397,7 +397,7 @@ NTSTATUS _netr_NetrEnumerateTrustedDomains(struct pipes_struct *p,
NTSTATUS status;
NTSTATUS result = NT_STATUS_OK;
DATA_BLOB blob;
- int num_domains = 0;
+ size_t num_domains = 0;
const char **trusted_domains = NULL;
struct lsa_DomainList domain_list;
struct dcerpc_binding_handle *h = NULL;
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index f6fbfda..1226ec1 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -4902,7 +4902,8 @@ static WERROR string_array_from_driver_info(TALLOC_CTX *mem_ctx,
const char *arch,
int version)
{
- int i, num_strings = 0;
+ int i;
+ size_t num_strings = 0;
const char **array = NULL;
if (string_array == NULL) {
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index fb011f8..c2b1e3d 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -1659,7 +1659,7 @@ static bool init_drv_info_3_members(TALLOC_CTX *mem_ctx, struct spoolss_AddDrive
char *args)
{
char *str, *str2;
- int count = 0;
+ size_t count = 0;
char *saveptr = NULL;
struct spoolss_StringArray *deps;
const char **file_array = NULL;
@@ -2636,7 +2636,8 @@ static WERROR cmd_spoolss_setprinterdata(struct rpc_pipe_client *cli,
data.binary = strhex_to_data_blob(mem_ctx, argv[4]);
break;
case REG_MULTI_SZ: {
- int i, num_strings;
+ int i;
+ size_t num_strings;
const char **strings = NULL;
num_strings = 0;
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 3a9780e..ccbe4f5 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1468,7 +1468,7 @@ static bool find_new_dc(TALLOC_CTX *mem_ctx,
int num_dcs = 0;
const char **dcnames = NULL;
- int num_dcnames = 0;
+ size_t num_dcnames = 0;
struct sockaddr_storage *addrs = NULL;
int num_addrs = 0;
diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index f663a2c..b7f5e58 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -110,6 +110,27 @@ static void b9_add_helper(struct dlz_bind9_data *state, const char *helper_name,
}
/*
+ * Add a trailing '.' if it's missing
+ */
+static const char *b9_format_fqdn(TALLOC_CTX *mem_ctx, const char *str)
+{
+ size_t len;
+ const char *tmp;
+
+ if (str == NULL || str[0] == '\0') {
+ return str;
+ }
+
+ len = strlen(str);
+ if (str[len-1] != '.') {
+ tmp = talloc_asprintf(mem_ctx, "%s.", str);
+ } else {
+ tmp = str;
+ }
+ return tmp;
+}
+
+/*
format a record for bind9
*/
static bool b9_format(struct dlz_bind9_data *state,
@@ -119,6 +140,7 @@ static bool b9_format(struct dlz_bind9_data *state,
{
uint32_t i;
char *tmp;
+ const char *fqdn;
switch (rec->wType) {
case DNS_TYPE_A:
@@ -133,7 +155,7 @@ static bool b9_format(struct dlz_bind9_data *state,
case DNS_TYPE_CNAME:
*type = "cname";
- *data = rec->data.cname;
+ *data = b9_format_fqdn(mem_ctx, rec->data.cname);
break;
case DNS_TYPE_TXT:
@@ -147,23 +169,30 @@ static bool b9_format(struct dlz_bind9_data *state,
case DNS_TYPE_PTR:
*type = "ptr";
- *data = rec->data.ptr;
+ *data = b9_format_fqdn(mem_ctx, rec->data.ptr);
break;
case DNS_TYPE_SRV:
*type = "srv";
+ fqdn = b9_format_fqdn(mem_ctx, rec->data.srv.nameTarget);
+ if (fqdn == NULL) {
+ return false;
+ }
*data = talloc_asprintf(mem_ctx, "%u %u %u %s",
rec->data.srv.wPriority,
rec->data.srv.wWeight,
rec->data.srv.wPort,
- rec->data.srv.nameTarget);
+ fqdn);
break;
case DNS_TYPE_MX:
*type = "mx";
+ fqdn = b9_format_fqdn(mem_ctx, rec->data.mx.nameTarget);
+ if (fqdn == NULL) {
+ return false;
+ }
*data = talloc_asprintf(mem_ctx, "%u %s",
- rec->data.mx.wPriority,
- rec->data.mx.nameTarget);
+ rec->data.mx.wPriority, fqdn);
break;
case DNS_TYPE_HINFO:
@@ -175,7 +204,7 @@ static bool b9_format(struct dlz_bind9_data *state,
case DNS_TYPE_NS:
*type = "ns";
- *data = rec->data.ns;
+ *data = b9_format_fqdn(mem_ctx, rec->data.ns);
break;
case DNS_TYPE_SOA: {
@@ -186,8 +215,9 @@ static bool b9_format(struct dlz_bind9_data *state,
* point at ourselves. This is how AD DNS servers
* force clients to send updates to the right local DC
*/
- mname = talloc_asprintf(mem_ctx, "%s.%s",
- lpcfg_netbios_name(state->lp), lpcfg_dnsdomain(state->lp));
+ mname = talloc_asprintf(mem_ctx, "%s.%s.",
+ lpcfg_netbios_name(state->lp),
+ lpcfg_dnsdomain(state->lp));
if (mname == NULL) {
return false;
}
@@ -196,11 +226,15 @@ static bool b9_format(struct dlz_bind9_data *state,
return false;
}
+ fqdn = b9_format_fqdn(mem_ctx, rec->data.soa.rname);
+ if (fqdn == NULL) {
+ return false;
+ }
+
state->soa_serial = rec->data.soa.serial;
*data = talloc_asprintf(mem_ctx, "%s %s %u %u %u %u %u",
- mname,
- rec->data.soa.rname,
+ mname, fqdn,
rec->data.soa.serial,
rec->data.soa.refresh,
rec->data.soa.retry,
@@ -792,7 +826,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);
@@ -853,7 +893,7 @@ static isc_result_t dlz_lookup_types(struct dlz_bind9_data *state,
/*
lookup one record
*/
-#ifdef BIND_VERSION_9_8
+#if DLZ_DLOPEN_VERSION == 1
_PUBLIC_ isc_result_t dlz_lookup(const char *zone, const char *name,
void *dbdata, dns_sdlzlookup_t *lookup)
#else
@@ -874,7 +914,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);
}
/*
@@ -949,6 +991,7 @@ _PUBLIC_ isc_result_t dlz_allnodes(const char *zone, void *dbdata,
} else {
name = talloc_asprintf(el_ctx, "%s.%s", rdn, zone);
}
+ name = b9_format_fqdn(el_ctx, name);
if (name == NULL) {
talloc_free(tmp_ctx);
return ISC_R_NOMEMORY;
@@ -1116,7 +1159,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 +1235,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/dlz_minimal.h b/source4/dns_server/dlz_minimal.h
index 98fb34e..11187f7 100644
--- a/source4/dns_server/dlz_minimal.h
+++ b/source4/dns_server/dlz_minimal.h
@@ -16,36 +16,49 @@
* USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/*
- This header provides a minimal set of defines and typedefs needed
- for building an external DLZ module for bind9. When creating a new
- external DLZ driver, please copy this header into your own source
- tree.
+/* This header is updated based on BIND 9.10.1 source.
+ * contrib/dlz/modules/include/dlz_minimal.h
*/
-typedef unsigned int isc_result_t;
+
+#ifndef DLZ_MINIMAL_H
+#define DLZ_MINIMAL_H 1
+
#ifdef BIND_VERSION_9_8
-typedef bool isc_boolean_t;
+#define DLZ_DLOPEN_VERSION 1
+#elif BIND_VERSION_9_9
+#define DLZ_DLOPEN_VERSION 2
+#elif BIND_VERSION_9_10
+#define DLZ_DLOPEN_VERSION 3
+#define DLZ_DLOPEN_AGE 0
#else
-typedef int isc_boolean_t;
+#error Unsupported BIND version
#endif
-typedef uint32_t dns_ttl_t;
-#ifdef BIND_VERSION_9_8
-#define DLZ_DLOPEN_VERSION 1
+typedef unsigned int isc_result_t;
+#if DLZ_DLOPEN_VERSION == 1
+typedef bool isc_boolean_t;
#else
-#define DLZ_DLOPEN_VERSION 2
+typedef int isc_boolean_t;
#endif
+typedef uint32_t dns_ttl_t;
-/* return this in flags to dlz_version() if thread safe */
+/* return these in flags from dlz_version() */
#define DNS_SDLZFLAG_THREADSAFE 0x00000001U
+#define DNS_SDLZFLAG_RELATIVEOWNER 0x00000002U
+#define DNS_SDLZFLAG_RELATIVERDATA 0x00000004U
/* result codes */
#define ISC_R_SUCCESS 0
#define ISC_R_NOMEMORY 1
#define ISC_R_NOPERM 6
+#define ISC_R_NOSPACE 19
#define ISC_R_NOTFOUND 23
#define ISC_R_FAILURE 25
+#define ISC_R_NOTIMPLEMENTED 27
#define ISC_R_NOMORE 29
+#define ISC_R_INVALIDFILE 30
+#define ISC_R_UNEXPECTED 34
+#define ISC_R_FILENOTFOUND 38
/* boolean values */
#define ISC_TRUE 1
@@ -57,16 +70,51 @@ typedef uint32_t dns_ttl_t;
#define ISC_LOG_WARNING (-3)
#define ISC_LOG_ERROR (-4)
--
Samba Shared Repository
More information about the samba-cvs
mailing list