[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Tue Aug 26 03:39:04 MDT 2014


The branch, master has been updated
       via  4383ec5 s4:setup/dns_update_list: make use of the new substitution variables
       via  f1544e8 s4:samba_dnsupdate: provide more substitution variables e.g. IF_RODC
       via  b139740 s4:samba_dnsupdate: don't try to be smart when verifying NS records
       via  25ec8e8 s4:samba_dnsupdate: cache the already registered records
       via  6e85370 s4:samba_dnsupdate: fix dnsobj.__str__()
       via  c5088f3 s4:samba_dnsupdate: don't lower case the registered names
       via  5533d9c python/join: use lowercase for the dnshostname.
       via  a9545f3 selftest/Samba3: also bind to ipv6
       via  5d4b36d selftest/Samba4: also bind to ipv6
       via  0e7abb3 selftest: export _IPV6 environment variables
       via  3fcc4a5 libcli/dns: ignore NS entries in dns_hosts_file.c at a higher log level for now
       via  7f18a3b libcli/dns: add AAAA support to dns_hosts_file.c
       via  5d397c8 s4:dlz_bind9: do an early talloc_free(el_ctx) in dlz_allnodes()
       via  fbebe7e s4:dlz_bind9: avoid some compiler warnings
       via  4917153 s4:dns_server: handle tombstones in handle_one_update()
       via  bb3ca93 s4:dns_server: add DNS_TYPE_TOMBSTONE support to dns_common_replace()
       via  a0a81ab s4:dns_server: make sure dns_common_lookup() doesn't return tombstones
       via  3ff025a s4:dns_server: use .wType = DNS_TYPE_TOMBSTONE instead of ZERO_STRUCT()
       via  0689e79 s4:dns_server: split out dns_common_replace()
       via  7e7df78 s4:dns_server: remove const from dns_replace_records()
       via  342a087 s4:dns_server: split out dns_common_extract() and dns_common_lookup()
       via  99d5a5e s4:dns_server: split out a private 'dnsserver_common' library
       via  d0f424a s4:dns_server: map LDB_ERR_NO_SUCH_OBJECT to WERR_DNS_ERROR_NAME_DOES_NOT_EXIST
       via  deb21a9 s4:dns_server: handle WERR_DNS_ERROR_NAME_DOES_NOT_EXIST in werr_to_dns_err()
      from  e914c2c smbd: Properly initialize mangle_hash

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4383ec5b83d12bd19749582217f082cbaa31a128
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Apr 28 18:54:13 2014 +0200

    s4:setup/dns_update_list: make use of the new substitution variables
    
    This let us register the same names as Windows Servers.
    
    We only exception are the NS records. In future we could add them
    by using something like this:
    
      samba-tool dns add ${HOSTNAME} ${DNSDOMAIN} @ NS ${HOSTNAME}
      samba-tool dns add ${HOSTNAME} _msdcs.${DNSFOREST} @ NS ${HOSTNAME}
      samba-tool dns add ${HOSTNAME} ${DNSFOREST} _msdcs NS ${HOSTNAME}
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Aug 26 11:38:54 CEST 2014 on sn-devel-104

commit f1544e8d1de995aa304d63352d313ace8fea6ca5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Apr 28 17:33:50 2014 +0200

    s4:samba_dnsupdate: provide more substitution variables e.g. IF_RODC
    
    This will make the dns_update_list more flexible.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit b13974048b74c60028d8387eb7fe4fc7734f0a91
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 8 00:05:03 2014 +0200

    s4:samba_dnsupdate: don't try to be smart when verifying NS records
    
    We can't rely on the DNS delegation to be correct in the parent domain.
    What we really want is to check if we already have registered ourself
    as a NS record in our own domain.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 25ec8e8656f66fe51a0d48718cdcfd8b209f6ca0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Apr 28 08:29:40 2014 +0200

    s4:samba_dnsupdate: cache the already registered records
    
    This way we can delete records which are not used anymore.
    
    E.g. if the ip address changed.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 6e853708def98545eeb6913b8a2dd59d439323e6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Apr 28 08:27:26 2014 +0200

    s4:samba_dnsupdate: fix dnsobj.__str__()
    
    We should not implicitly use the global variable 'd'.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit c5088f338a38850674399ec8fec9f8f146b5880f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Apr 28 17:26:51 2014 +0200

    s4:samba_dnsupdate: don't lower case the registered names
    
    This matches Windows...
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 5533d9c3db31ac86769288527ec20ad4e57f703c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 19 10:33:11 2014 +0200

    python/join: use lowercase for the dnshostname.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a9545f3de7aaa0346735191953f78242017bd346
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jun 19 17:21:16 2014 +0200

    selftest/Samba3: also bind to ipv6
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 5d4b36d1fec981e850d869edd2c98a6541b37114
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jun 19 17:21:16 2014 +0200

    selftest/Samba4: also bind to ipv6
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0e7abb398dd826c082bbddb333b9faac361be064
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jun 19 17:21:16 2014 +0200

    selftest: export _IPV6 environment variables
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 3fcc4a545e936c2c0cf3f9f9a19646e1512f74d2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 10 07:25:08 2014 +0200

    libcli/dns: ignore NS entries in dns_hosts_file.c at a higher log level for now
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 7f18a3b58e7146e421653b85f509bb8503bd7402
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 10 07:25:08 2014 +0200

    libcli/dns: add AAAA support to dns_hosts_file.c
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 5d397c8198bcd2cdccc3deda57377d4696e6abd1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 30 17:57:13 2014 +0200

    s4:dlz_bind9: do an early talloc_free(el_ctx) in dlz_allnodes()
    
    We don't have to keep everything arround while walking the whole zone.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit fbebe7e756e4ccd0684e94e9b1e787f98f399ccc
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 27 09:59:51 2014 +0100

    s4:dlz_bind9: avoid some compiler warnings
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 491715399ff7e1ab788fec5e254581dc312e2cef
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 31 09:35:26 2014 +0200

    s4:dns_server: handle tombstones in handle_one_update()
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit bb3ca930cc57964487bd23a74f4caabd1616a8bf
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 31 10:44:41 2014 +0200

    s4:dns_server: add DNS_TYPE_TOMBSTONE support to dns_common_replace()
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Pair-Programmed-With: Michael Adam <obnox at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a0a81ab01cb1d509b04f9af25177c8e0941b43aa
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 31 08:54:17 2014 +0200

    s4:dns_server: make sure dns_common_lookup() doesn't return tombstones
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 3ff025a02cca3ff209668edd419d0e440e9865c6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 31 09:32:00 2014 +0200

    s4:dns_server: use .wType = DNS_TYPE_TOMBSTONE instead of ZERO_STRUCT()
    
    The result is the same, but it is clearer.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0689e795e073008d2ad539c0ef5ddbdc6d9efdac
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 30 18:27:56 2014 +0200

    s4:dns_server: split out dns_common_replace()
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 7e7df78bd7ae5575da7443b45c0e2e4167eebde2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 31 11:32:02 2014 +0200

    s4:dns_server: remove const from dns_replace_records()
    
    All callers are find we the record array gets modified.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 342a087349f8a10833338a3fa49fbd4d4d29f3e5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 30 08:24:10 2014 +0200

    s4:dns_server: split out dns_common_extract() and dns_common_lookup()
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 99d5a5ead4f33723c25e8716a79d34b53822521e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 30 08:01:11 2014 +0200

    s4:dns_server: split out a private 'dnsserver_common' library
    
    This will contain common code for the internal dns server, the dlz_bind9 module
    and the rpc dns management server.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit d0f424a23dc915d9fce625438d2bd63519757cba
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 31 08:19:50 2014 +0200

    s4:dns_server: map LDB_ERR_NO_SUCH_OBJECT to WERR_DNS_ERROR_NAME_DOES_NOT_EXIST
    
    This is the correct fix for commit 8b24c43b382740106474e26dec59e1419ba77306
    and Bug: https://bugzilla.samba.org/show_bug.cgi?id=9559
    
    With this change we have a consistent behavior between internal server
    and the bind dlz module. We keep a dangling LDAP object without
    dnsRecord attribute arround forever. This will be fixed in the following
    commits.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit deb21a9afe77591743fda522355a5a9eb08fb27b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 30 17:55:57 2014 +0200

    s4:dns_server: handle WERR_DNS_ERROR_NAME_DOES_NOT_EXIST in werr_to_dns_err()
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 libcli/dns/dns_hosts_file.c           |   35 +++-
 python/samba/join.py                  |    4 +-
 selftest/README                       |    1 +
 selftest/selftest.pl                  |    6 +
 selftest/target/Samba3.pm             |   19 ++-
 selftest/target/Samba4.pm             |   24 ++-
 source4/dns_server/dlz_bind9.c        |    8 +-
 source4/dns_server/dlz_minimal.h      |    2 +-
 source4/dns_server/dns_server.h       |    6 +-
 source4/dns_server/dns_update.c       |   78 +++++---
 source4/dns_server/dns_utils.c        |  150 +--------------
 source4/dns_server/dnsserver_common.c |  342 +++++++++++++++++++++++++++++++++
 source4/dns_server/dnsserver_common.h |   50 +++++
 source4/dns_server/wscript_build      |    8 +-
 source4/dsdb/dns/dns_update.c         |   13 ++
 source4/scripting/bin/samba_dnsupdate |  213 ++++++++++++++++-----
 source4/setup/dns_update_list         |   82 +++++----
 source4/torture/dns/dlz_bind9.c       |    7 +-
 18 files changed, 770 insertions(+), 278 deletions(-)
 create mode 100644 source4/dns_server/dnsserver_common.c
 create mode 100644 source4/dns_server/dnsserver_common.h


Changeset truncated at 500 lines:

diff --git a/libcli/dns/dns_hosts_file.c b/libcli/dns/dns_hosts_file.c
index 94d1d97..4b1bc53 100644
--- a/libcli/dns/dns_hosts_file.c
+++ b/libcli/dns/dns_hosts_file.c
@@ -88,9 +88,14 @@ static bool getdns_hosts_fileent(TALLOC_CTX *ctx, XFILE *fp, char **pp_name, cha
 
 		if (next_token_talloc(ctx, &ptr, &name_type, NULL))
 			++count;
+		if (count == 0) {
+			continue;
+		}
 		if (next_token_talloc(ctx, &ptr, &name, NULL))
 			++count;
-		if (name_type && strcasecmp(name_type, "A") == 0) {
+		if ((strcasecmp(name_type, "A") == 0) ||
+		    (strcasecmp(name_type, "AAAA") == 0))
+		{
 			if (next_token_talloc(ctx, &ptr, &ip, NULL))
 				++count;
 		} else if (name_type && strcasecmp(name_type, "SRV") == 0) {
@@ -101,13 +106,18 @@ static bool getdns_hosts_fileent(TALLOC_CTX *ctx, XFILE *fp, char **pp_name, cha
 		} else if (name_type && strcasecmp(name_type, "CNAME") == 0) {
 			if (next_token_talloc(ctx, &ptr, &next_name, NULL))
 				++count;
+		} else if (name_type && strcasecmp(name_type, "NS") == 0) {
+			if (next_token_talloc(ctx, &ptr, &next_name, NULL))
+				++count;
 		}
 		if (count <= 0)
 			continue;
 
-		if (strcasecmp(name_type, "A") == 0) {
+		if ((strcasecmp(name_type, "A") == 0) ||
+		    (strcasecmp(name_type, "AAAA") == 0))
+		{
 			if (count != 3) {
-				DEBUG(0,("getdns_hosts_fileent: Ill formed hosts A record [%s]\n",
+				DEBUG(0,("getdns_hosts_fileent: Ill formed hosts A[AAA] record [%s]\n",
 					 line));
 				continue;
 			}
@@ -148,6 +158,15 @@ static bool getdns_hosts_fileent(TALLOC_CTX *ctx, XFILE *fp, char **pp_name, cha
 			if (!*pp_next_name) {
 				return false;
 			}
+		} else if (strcasecmp(name_type, "NS") == 0) {
+			if (count != 3) {
+				DEBUG(0,("getdns_hosts_fileent: Ill formed hosts NS record [%s]\n",
+					 line));
+				continue;
+			}
+			DEBUG(4, ("getdns_hosts_fileent: NS entry: %s %s %s\n",
+				  name_type, name, next_name));
+			continue;
 		} else {
 			DEBUG(0,("getdns_hosts_fileent: unknown type %s\n", name_type));
 			continue;
@@ -215,7 +234,7 @@ static NTSTATUS resolve_dns_hosts_file_as_dns_rr_recurse(const char *dns_hosts_f
 
 	DEBUG(3,("resolve_dns_hosts: (%d) "
 		 "Attempting %s dns_hosts lookup for name %s\n",
-		 level, srv_lookup ? "SRV" : "A", name));
+		 level, srv_lookup ? "SRV" : "A[AAA]", name));
 
 	fp = startdns_hosts_file(dns_hosts_file);
 
@@ -278,7 +297,9 @@ static NTSTATUS resolve_dns_hosts_file_as_dns_rr_recurse(const char *dns_hosts_f
 									  mem_ctx, return_rr, return_count);
 			talloc_free(ip_list_ctx);
 			return status;
-		} else if (strcasecmp(name_type, "A") == 0) {
+		} else if ((strcasecmp(name_type, "A") == 0) ||
+			   (strcasecmp(name_type, "AAAA") == 0))
+		{
 			if (*return_count == 0) {
 				/* We are happy to keep looking for other possible A record matches */
 				rr = talloc_zero(ip_list_ctx,
@@ -405,11 +426,11 @@ NTSTATUS resolve_dns_hosts_file_as_dns_rr(const char *dns_hosts_file,
 	if (NT_STATUS_IS_OK(status)) {
 		DEBUG(3,("resolve_dns_hosts (dns_rr): "
 			 "Found %d %s result records for for name %s\n",
-			 *return_count, srv_lookup ? "SRV" : "A", name));
+			 *return_count, srv_lookup ? "SRV" : "A[AAA]", name));
 	} else {
 		DEBUG(3,("resolve_dns_hosts (dns_rr): "
 			 "failed to obtain %s result records for for name %s: %s\n",
-			 srv_lookup ? "SRV" : "A", name, nt_errstr(status)));
+			 srv_lookup ? "SRV" : "A[AAA]", name, nt_errstr(status)));
 	}
 	return status;
 }
diff --git a/python/samba/join.py b/python/samba/join.py
index f8ede5d..a5211bc 100644
--- a/python/samba/join.py
+++ b/python/samba/join.py
@@ -134,7 +134,7 @@ class dc_join(object):
             else:
                 ctx.dns_backend = dns_backend
 
-        ctx.dnshostname = "%s.%s" % (ctx.myname, ctx.dnsdomain)
+        ctx.dnshostname = "%s.%s" % (ctx.myname.lower(), ctx.dnsdomain)
 
         ctx.realm = ctx.dnsdomain
 
@@ -1206,7 +1206,7 @@ def join_subdomain(logger=None, server=None, creds=None, lp=None, site=None,
     ctx.base_dn = samba.dn_from_dns_name(dnsdomain)
     ctx.domsid = str(security.random_sid())
     ctx.acct_dn = None
-    ctx.dnshostname = "%s.%s" % (ctx.myname, ctx.dnsdomain)
+    ctx.dnshostname = "%s.%s" % (ctx.myname.lower(), ctx.dnsdomain)
     ctx.trustdom_pass = samba.generate_random_password(128, 128)
 
     ctx.userAccountControl = samba.dsdb.UF_SERVER_TRUST_ACCOUNT | samba.dsdb.UF_TRUSTED_FOR_DELEGATION
diff --git a/selftest/README b/selftest/README
index c23d730..d9ad020 100644
--- a/selftest/README
+++ b/selftest/README
@@ -89,6 +89,7 @@ The environments are currently available include
      * REALM: Realm name
      * SERVER: DC host name 
      * SERVER_IP: DC IPv4 address
+     * SERVER_IPV6: DC IPv6 address
      * NETBIOSNAME: DC NetBIOS name
      * NETIOSALIAS: DC NetBIOS alias
 
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index fde8451..8342bfe 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -707,35 +707,41 @@ my @exported_envvars = (
 	# domain controller stuff
 	"DC_SERVER",
 	"DC_SERVER_IP",
+	"DC_SERVER_IPV6",
 	"DC_NETBIOSNAME",
 	"DC_NETBIOSALIAS",
 
 	# domain member
 	"MEMBER_SERVER",
 	"MEMBER_SERVER_IP",
+	"MEMBER_SERVER_IPV6",
 	"MEMBER_NETBIOSNAME",
 	"MEMBER_NETBIOSALIAS",
 
 	# rpc proxy controller stuff
 	"RPC_PROXY_SERVER",
 	"RPC_PROXY_SERVER_IP",
+	"RPC_PROXY_SERVER_IPV6",
 	"RPC_PROXY_NETBIOSNAME",
 	"RPC_PROXY_NETBIOSALIAS",
 
 	# domain controller stuff for Vampired DC
 	"VAMPIRE_DC_SERVER",
 	"VAMPIRE_DC_SERVER_IP",
+	"VAMPIRE_DC_SERVER_IPV6",
 	"VAMPIRE_DC_NETBIOSNAME",
 	"VAMPIRE_DC_NETBIOSALIAS",
 
 	"PROMOTED_DC_SERVER",
 	"PROMOTED_DC_SERVER_IP",
+	"PROMOTED_DC_SERVER_IPV6",
 	"PROMOTED_DC_NETBIOSNAME",
 	"PROMOTED_DC_NETBIOSALIAS",
 
 	# server stuff
 	"SERVER",
 	"SERVER_IP",
+	"SERVER_IPV6",
 	"NETBIOSNAME",
 	"NETBIOSALIAS",
 
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index a17f2f6..5544105 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -229,6 +229,7 @@ sub setup_s3dc($$)
 
 	$vars->{DC_SERVER} = $vars->{SERVER};
 	$vars->{DC_SERVER_IP} = $vars->{SERVER_IP};
+	$vars->{DC_SERVER_IPV6} = $vars->{SERVER_IPV6};
 	$vars->{DC_NETBIOSNAME} = $vars->{NETBIOSNAME};
 	$vars->{DC_USERNAME} = $vars->{USERNAME};
 	$vars->{DC_PASSWORD} = $vars->{PASSWORD};
@@ -273,6 +274,7 @@ sub setup_member($$$)
 
 	$ret->{DC_SERVER} = $s3dcvars->{SERVER};
 	$ret->{DC_SERVER_IP} = $s3dcvars->{SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $s3dcvars->{SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $s3dcvars->{NETBIOSNAME};
 	$ret->{DC_USERNAME} = $s3dcvars->{USERNAME};
 	$ret->{DC_PASSWORD} = $s3dcvars->{PASSWORD};
@@ -344,6 +346,7 @@ sub setup_admember($$$$)
 
 	$ret->{DC_SERVER} = $dcvars->{SERVER};
 	$ret->{DC_SERVER_IP} = $dcvars->{SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $dcvars->{SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $dcvars->{NETBIOSNAME};
 	$ret->{DC_USERNAME} = $dcvars->{USERNAME};
 	$ret->{DC_PASSWORD} = $dcvars->{PASSWORD};
@@ -423,6 +426,7 @@ sub setup_admember_rfc2307($$$$)
 
 	$ret->{DC_SERVER} = $dcvars->{SERVER};
 	$ret->{DC_SERVER_IP} = $dcvars->{SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $dcvars->{SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $dcvars->{NETBIOSNAME};
 	$ret->{DC_USERNAME} = $dcvars->{USERNAME};
 	$ret->{DC_PASSWORD} = $dcvars->{PASSWORD};
@@ -814,6 +818,7 @@ sub provision($$$$$$)
 	my $swiface = Samba::get_interface($server);
 	my %ret = ();
 	my $server_ip = "127.0.0.$swiface";
+	my $server_ipv6 = sprintf("fd00:0000:0000:0000:0000:0000:5357:5f%02x", $swiface);
 	my $domain = "SAMBA-TEST";
 
 	my $unix_name = ($ENV{USER} or $ENV{LOGNAME} or `PATH=/usr/ucb:$ENV{PATH} whoami`);
@@ -918,7 +923,7 @@ sub provision($$$$$$)
 	close(MSDFS_TARGET);
 	chmod 0666, $msdfs_target;
 	symlink "msdfs:$server_ip\\ro-tmp", "$msdfs_shrdir/msdfs-src1";
-	symlink "msdfs:$server_ip\\ro-tmp", "$msdfs_shrdir/deeppath/msdfs-src2";
+	symlink "msdfs:$server_ipv6\\ro-tmp", "$msdfs_shrdir/deeppath/msdfs-src2";
 
 	my $conffile="$libdir/server.conf";
 
@@ -973,7 +978,7 @@ sub provision($$$$$$)
 	print CONF "
 [global]
 	netbios name = $server
-	interfaces = $server_ip/8
+	interfaces = $server_ip/8 $server_ipv6/64
 	bind interfaces only = yes
 	panic action = cd $self->{srcdir} && $self->{srcdir}/selftest/gdb_backtrace %d %\$(MAKE_TEST_BINARY)
 	smbd:suicide mode = yes
@@ -1222,8 +1227,8 @@ domadmins:X:$gid_domadmins:
 		warn("Unable to open $nss_wrapper_hosts");
 		return undef;
 	}
-	print HOSTS "${server_ip} ${hostname}.samba.example.com ${hostname}
-";
+	print HOSTS "${server_ip} ${hostname}.samba.example.com ${hostname}\n";
+	print HOSTS "${server_ipv6} ${hostname}.samba.example.com ${hostname}\n";
 	close(HOSTS);
 
 
@@ -1250,14 +1255,16 @@ domadmins:X:$gid_domadmins:
 	print "DONE\n";
 
 	open(DNS_UPDATE_LIST, ">$prefix/dns_update_list") or die("Unable to open $$prefix/dns_update_list");
-	print DNS_UPDATE_LIST "A $server. $server_ip";
+	print DNS_UPDATE_LIST "A $server. $server_ip\n";
+	print DNS_UPDATE_LIST "AAAA $server. $server_ipv6\n";
 	close(DNS_UPDATE_LIST);
 
-        if (system("$ENV{SRCDIR_ABS}/source4/scripting/bin/samba_dnsupdate --all-interfaces --use-file=$dns_host_file -s $conffile --update-list=$prefix/dns_update_list --no-substiutions --no-credentials") != 0) {
+        if (system("$ENV{SRCDIR_ABS}/source4/scripting/bin/samba_dnsupdate --all-interfaces --use-file=$dns_host_file -s $conffile --update-list=$prefix/dns_update_list --update-cache=$prefix/dns_update_cache --no-substiutions --no-credentials") != 0) {
                 die "Unable to update hostname into $dns_host_file";
         }
 
 	$ret{SERVER_IP} = $server_ip;
+	$ret{SERVER_IPV6} = $server_ipv6;
 	$ret{NMBD_TEST_LOG} = "$prefix/nmbd_test.log";
 	$ret{NMBD_TEST_LOG_POS} = 0;
 	$ret{WINBINDD_TEST_LOG} = "$prefix/winbindd_test.log";
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index ffaf2be..32043b9 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -536,7 +536,8 @@ sub provision_raw_prepare($$$$$$$$$$)
 	$ctx->{tlsdir} = "$ctx->{privatedir}/tls";
 
 	$ctx->{ipv4} = "127.0.0.$swiface";
-	$ctx->{interfaces} = "$ctx->{ipv4}/8";
+	$ctx->{ipv6} = sprintf("fd00:0000:0000:0000:0000:0000:5357:5f%02x", $swiface);
+	$ctx->{interfaces} = "$ctx->{ipv4}/8 $ctx->{ipv6}/64";
 
 	push(@{$ctx->{directories}}, $ctx->{privatedir});
 	push(@{$ctx->{directories}}, $ctx->{etcdir});
@@ -702,8 +703,8 @@ $ctx->{unix_name}:x:$ctx->{unix_gid}:
 
 	my $hostname = lc($ctx->{hostname});
 	open(HOSTS, ">>$ctx->{nsswrap_hosts}");
-	print HOSTS "$ctx->{ipv4} ${hostname}.samba.example.com ${hostname}
-";
+	print HOSTS "$ctx->{ipv4} ${hostname}.samba.example.com ${hostname}\n";
+	print HOSTS "$ctx->{ipv6} ${hostname}.samba.example.com ${hostname}\n";
 	close(HOSTS);
 
 	my $configuration = "--configfile=$ctx->{smb_conf}";
@@ -725,6 +726,7 @@ $ctx->{unix_name}:x:$ctx->{unix_gid}:
 		PIDDIR => $ctx->{piddir},
 		SERVER => $ctx->{hostname},
 		SERVER_IP => $ctx->{ipv4},
+		SERVER_IPV6 => $ctx->{ipv6},
 		NETBIOSNAME => $ctx->{netbiosname},
 		DOMAIN => $ctx->{domain},
 		USERNAME => $ctx->{username},
@@ -973,12 +975,14 @@ rpc_server:tcpip = no
 
 	$ret->{MEMBER_SERVER} = $ret->{SERVER};
 	$ret->{MEMBER_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{MEMBER_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{MEMBER_NETBIOSNAME} = $ret->{NETBIOSNAME};
 	$ret->{MEMBER_USERNAME} = $ret->{USERNAME};
 	$ret->{MEMBER_PASSWORD} = $ret->{PASSWORD};
 
 	$ret->{DC_SERVER} = $dcvars->{DC_SERVER};
 	$ret->{DC_SERVER_IP} = $dcvars->{DC_SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $dcvars->{DC_SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $dcvars->{DC_NETBIOSNAME};
 	$ret->{DC_USERNAME} = $dcvars->{DC_USERNAME};
 	$ret->{DC_PASSWORD} = $dcvars->{DC_PASSWORD};
@@ -1068,12 +1072,14 @@ sub provision_rpc_proxy($$$)
 
 	$ret->{RPC_PROXY_SERVER} = $ret->{SERVER};
 	$ret->{RPC_PROXY_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{RPC_PROXY_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{RPC_PROXY_NETBIOSNAME} = $ret->{NETBIOSNAME};
 	$ret->{RPC_PROXY_USERNAME} = $ret->{USERNAME};
 	$ret->{RPC_PROXY_PASSWORD} = $ret->{PASSWORD};
 
 	$ret->{DC_SERVER} = $dcvars->{DC_SERVER};
 	$ret->{DC_SERVER_IP} = $dcvars->{DC_SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $dcvars->{DC_SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $dcvars->{DC_NETBIOSNAME};
 	$ret->{DC_USERNAME} = $dcvars->{DC_USERNAME};
 	$ret->{DC_PASSWORD} = $dcvars->{DC_PASSWORD};
@@ -1144,10 +1150,12 @@ sub provision_promoted_dc($$$)
 
 	$ret->{PROMOTED_DC_SERVER} = $ret->{SERVER};
 	$ret->{PROMOTED_DC_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{PROMOTED_DC_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{PROMOTED_DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
 
 	$ret->{DC_SERVER} = $dcvars->{DC_SERVER};
 	$ret->{DC_SERVER_IP} = $dcvars->{DC_SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $dcvars->{DC_SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $dcvars->{DC_NETBIOSNAME};
 	$ret->{DC_USERNAME} = $dcvars->{DC_USERNAME};
 	$ret->{DC_PASSWORD} = $dcvars->{DC_PASSWORD};
@@ -1205,10 +1213,12 @@ sub provision_vampire_dc($$$)
 
 	$ret->{VAMPIRE_DC_SERVER} = $ret->{SERVER};
 	$ret->{VAMPIRE_DC_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{VAMPIRE_DC_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{VAMPIRE_DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
 
 	$ret->{DC_SERVER} = $dcvars->{DC_SERVER};
 	$ret->{DC_SERVER_IP} = $dcvars->{DC_SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $dcvars->{DC_SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $dcvars->{DC_NETBIOSNAME};
 	$ret->{DC_USERNAME} = $dcvars->{DC_USERNAME};
 	$ret->{DC_PASSWORD} = $dcvars->{DC_PASSWORD};
@@ -1270,10 +1280,12 @@ sub provision_subdom_dc($$$)
 
 	$ret->{SUBDOM_DC_SERVER} = $ret->{SERVER};
 	$ret->{SUBDOM_DC_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{SUBDOM_DC_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{SUBDOM_DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
 
 	$ret->{DC_SERVER} = $dcvars->{DC_SERVER};
 	$ret->{DC_SERVER_IP} = $dcvars->{DC_SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $dcvars->{DC_SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $dcvars->{DC_NETBIOSNAME};
 	$ret->{DC_USERNAME} = $dcvars->{DC_USERNAME};
 	$ret->{DC_PASSWORD} = $dcvars->{DC_PASSWORD};
@@ -1305,6 +1317,7 @@ sub provision_dc($$)
 	$ret->{NETBIOSALIAS} = "localdc1-a";
 	$ret->{DC_SERVER} = $ret->{SERVER};
 	$ret->{DC_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
 	$ret->{DC_USERNAME} = $ret->{USERNAME};
 	$ret->{DC_PASSWORD} = $ret->{PASSWORD};
@@ -1355,6 +1368,7 @@ sub provision_fl2003dc($$)
 
 	$ret->{DC_SERVER} = $ret->{SERVER};
 	$ret->{DC_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
 	$ret->{DC_USERNAME} = $ret->{USERNAME};
 	$ret->{DC_PASSWORD} = $ret->{PASSWORD};
@@ -1477,10 +1491,12 @@ sub provision_rodc($$$)
 
 	$ret->{RODC_DC_SERVER} = $ret->{SERVER};
 	$ret->{RODC_DC_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{RODC_DC_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{RODC_DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
 
 	$ret->{DC_SERVER} = $dcvars->{DC_SERVER};
 	$ret->{DC_SERVER_IP} = $dcvars->{DC_SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $dcvars->{DC_SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $dcvars->{DC_NETBIOSNAME};
 	$ret->{DC_USERNAME} = $dcvars->{DC_USERNAME};
 	$ret->{DC_PASSWORD} = $dcvars->{DC_PASSWORD};
@@ -1597,6 +1613,7 @@ sub provision_plugin_s4_dc($$)
 
 	$ret->{DC_SERVER} = $ret->{SERVER};
 	$ret->{DC_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
 	$ret->{DC_USERNAME} = $ret->{USERNAME};
 	$ret->{DC_PASSWORD} = $ret->{PASSWORD};
@@ -1639,6 +1656,7 @@ sub provision_chgdcpass($$)
 	    
 	$ret->{DC_SERVER} = $ret->{SERVER};
 	$ret->{DC_SERVER_IP} = $ret->{SERVER_IP};
+	$ret->{DC_SERVER_IPV6} = $ret->{SERVER_IPV6};
 	$ret->{DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
 	$ret->{DC_USERNAME} = $ret->{USERNAME};
 	$ret->{DC_PASSWORD} = $ret->{PASSWORD};
diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 3ffb06b..83b6070 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -466,7 +466,7 @@ static isc_result_t b9_putnamedrr(struct dlz_bind9_data *state,
    parse options
  */
 static isc_result_t parse_options(struct dlz_bind9_data *state,
-				  unsigned int argc, char *argv[],
+				  unsigned int argc, const char **argv,
 				  struct b9_options *options)
 {
 	int opt;
@@ -477,7 +477,7 @@ static isc_result_t parse_options(struct dlz_bind9_data *state,
 		{ NULL }
 	};
 
-	pc = poptGetContext("dlz_bind9", argc, (const char **)argv, long_options,
+	pc = poptGetContext("dlz_bind9", argc, argv, long_options,
 			POPT_CONTEXT_KEEP_FIRST);
 	while ((opt = poptGetNextOpt(pc)) != -1) {
 		switch (opt) {
@@ -571,7 +571,7 @@ static int dlz_state_debug_unregister(struct dlz_bind9_data *state)
   called to initialise the driver
  */
 _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
-				 unsigned int argc, char *argv[],
+				 unsigned int argc, const char **argv,
 				 void **dbdata, ...)
 {
 	struct dlz_bind9_data *state;
@@ -987,6 +987,8 @@ _PUBLIC_ isc_result_t dlz_allnodes(const char *zone, void *dbdata,
 				continue;
 			}
 		}
+
+		talloc_free(el_ctx);
 	}
 
 	talloc_free(tmp_ctx);
diff --git a/source4/dns_server/dlz_minimal.h b/source4/dns_server/dlz_minimal.h
index 5262cbd..98fb34e 100644
--- a/source4/dns_server/dlz_minimal.h
+++ b/source4/dns_server/dlz_minimal.h
@@ -100,7 +100,7 @@ int dlz_version(unsigned int *flags);
 /*
  * dlz_create() is required for all DLZ external drivers.
  */
-isc_result_t dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata, ...);
+isc_result_t dlz_create(const char *dlzname, unsigned int argc, const char **argv, void **dbdata, ...);
 
 /*
  * dlz_destroy() is optional, and will be called when the driver is
diff --git a/source4/dns_server/dns_server.h b/source4/dns_server/dns_server.h
index efe4db8..12ccc9b 100644
--- a/source4/dns_server/dns_server.h
+++ b/source4/dns_server/dns_server.h
@@ -86,7 +86,6 @@ WERROR dns_server_process_update(struct dns_server *dns,
 				 struct dns_res_rec **updates,    uint16_t *update_count,
 				 struct dns_res_rec **additional, uint16_t *arcount);
 
-uint8_t werr_to_dns_err(WERROR werror);
 bool dns_name_match(const char *zone, const char *name, size_t *host_part_len);
 bool dns_name_equal(const char *name1, const char *name2);
 bool dns_records_match(struct dnsp_DnssrvRpcRecord *rec1,
@@ -102,7 +101,7 @@ WERROR dns_replace_records(struct dns_server *dns,
 			   TALLOC_CTX *mem_ctx,
 			   struct ldb_dn *dn,
 			   bool needs_add,
-			   const struct dnsp_DnssrvRpcRecord *records,
+			   struct dnsp_DnssrvRpcRecord *records,
 			   uint16_t rec_count);
 WERROR dns_name2dn(struct dns_server *dns,
 		   TALLOC_CTX *mem_ctx,
@@ -124,5 +123,6 @@ WERROR dns_sign_tsig(struct dns_server *dns,
 		     struct dns_name_packet *packet,
 		     uint16_t error);
 
-#define DNS_ERR(err_str) WERR_DNS_ERROR_RCODE_##err_str
+#include "source4/dns_server/dnsserver_common.h"
+
 #endif /* __DNS_SERVER_H__ */
diff --git a/source4/dns_server/dns_update.c b/source4/dns_server/dns_update.c
index 9edc40b..04e7d9a 100644
--- a/source4/dns_server/dns_update.c
+++ b/source4/dns_server/dns_update.c
@@ -82,6 +82,9 @@ static WERROR check_one_prerequisite(struct dns_server *dns,
 			/*
 			 */
 			werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list