[SCM] Samba Shared Repository - branch v4-1-test updated
Karolin Seeger
kseeger at samba.org
Mon Nov 24 15:28:02 MST 2014
The branch, v4-1-test has been updated
via 4ddd4c6 s4-dns: dlz-bind: Add trailing '.' to all fqdn strings
via a5adad6 s4-dns: Add support for BIND 9.10
via a30eeec s4-dns: Update dlz_minimal.h based on BIND release 9.10
via 8fed025 s4-dns: Check DLZ_DLOPEN_VERSION for different BIND versions
via 221934c s4-dns: Update template variables, change BIND98 --> BIND9_8
via c4ae1b4 samba: pass down size_t instead of int to add_string_to_array().
via fed8ae0 lib/util: use size_t for add_string_to_array().
via e0b65dd s3-proto: remove duplicate proto for add_string_to_array().
from 2947da5 Revert "buildtools: Rename perl vendorarch configure option."
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-1-test
- Log -----------------------------------------------------------------
commit 4ddd4c6ace28cdb1440587b719061a626c9377a3
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-1-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-1-test): Mon Nov 24 23:27:37 CET 2014 on sn-devel-104
commit a5adad6f82517ae07db4eadadcef1cfd475b55d5
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)
Conflicts:
python/samba/provision/sambadns.py
source4/dns_server/dlz_bind9.c
source4/setup/named.conf.dlz
commit a30eeec0606952df43835fb3f51357d06952e1cd
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 8fed02562e008af9b49dca5c02a95af81e9e5abd
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 221934c68dd7accbb415393c377c7f09d0dd41a1
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)
Conflicts:
python/samba/provision/sambadns.py
source4/setup/named.conf.dlz
commit c4ae1b4d1796d57fbf18e1b38b1f3896f18c9378
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 fed8ae0a3923e425f5d45af3c7e5d87e9e6c6507
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 e0b65ddefc5e8bf11ad284899c17109163d11d9f
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>
-----------------------------------------------------------------------
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 +-
source3/include/proto.h | 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 | 77 ++++++++--
source4/dns_server/dlz_minimal.h | 227 ++++++++++++++++++++--------
source4/dns_server/wscript_build | 10 ++
source4/setup/named.conf.dlz | 7 +-
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 +-
21 files changed, 279 insertions(+), 115 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index c6eb349..7687e1b 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -316,7 +316,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 e8d2a74..33c1e08 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 eb7e620..b41f7f5 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 df84475..56d019d 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/source3/include/proto.h b/source3/include/proto.h
index cbad7ac..4eb7ba4 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -718,9 +718,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/eventlog/eventlog.c b/source3/lib/eventlog/eventlog.c
index 0cc0240..7a190bd 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 8d104c2..b9adc9d 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -3300,7 +3300,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 aa7b5cb..9a34e94 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -421,7 +421,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);
}
@@ -446,7 +446,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 46f42d5..6b0028b 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 e5ca474..c903ae8 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 3812153..c451212 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -4897,7 +4897,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 5c499d4..3f83abf 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 8bbc886..ee4b482 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1443,7 +1443,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 38b765a..604d4b9 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -103,6 +103,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,
@@ -112,6 +133,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:
@@ -126,7 +148,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:
@@ -140,23 +162,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:
@@ -168,7 +197,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: {
@@ -179,8 +208,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;
}
@@ -189,11 +219,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,
@@ -785,7 +819,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);
@@ -846,7 +886,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
@@ -867,7 +907,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);
}
/*
@@ -942,6 +984,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;
@@ -1073,7 +1116,12 @@ static bool b9_has_soa(struct dlz_bind9_data *state, struct ldb_dn *dn, const ch
/*
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;
@@ -1132,7 +1180,12 @@ _PUBLIC_ isc_result_t dlz_configure(dns_view_t *view, void *dbdata)
if (!b9_has_soa(state, zone_dn, zone)) {
continue;
}
+
+#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)
#define ISC_LOG_CRITICAL (-5)
+#define ISC_LOG_DEBUG(level) (level)
-/* some opaque structures */
+/* opaque structures */
typedef void *dns_sdlzlookup_t;
typedef void *dns_sdlzallnodes_t;
typedef void *dns_view_t;
-typedef void *dns_clientinfomethods_t;
-typedef void *dns_clientinfo_t;
+typedef void *dns_dlzdb_t;
+
+#if DLZ_DLOPEN_VERSION > 1
+/*
+ * Method and type definitions needed for retrieval of client info
+ * from the caller.
+ */
+typedef struct isc_sockaddr {
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+ struct sockaddr_un sunix;
+ } type;
+ unsigned int length;
+ void * link;
+} isc_sockaddr_t;
+
+#define DNS_CLIENTINFO_VERSION 1
+typedef struct dns_clientinfo {
+ uint16_t version;
+ void *data;
+} dns_clientinfo_t;
+
+typedef isc_result_t (*dns_clientinfo_sourceip_t)(dns_clientinfo_t *client,
+ isc_sockaddr_t **addrp);
+
+#define DNS_CLIENTINFOMETHODS_VERSION 1
+#define DNS_CLIENTINFOMETHODS_AGE 0
+
+typedef struct dns_clientinfomethods {
+ uint16_t version;
+ uint16_t age;
+ dns_clientinfo_sourceip_t sourceip;
+} dns_clientinfomethods_t;
+#endif /* DLZ_DLOPEN_VERSION > 1 */
/*
- * method definitions for callbacks provided by dlopen driver
--
Samba Shared Repository
More information about the samba-cvs
mailing list