[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Sat Jun 1 04:47:03 MDT 2013


The branch, master has been updated
       via  42b0b27 param_table: Remove misleading allow dns updates options.
       via  5528551 docs: Avoid mentioning a possibly misleading option.
       via  7c4c896 WHATSNEW: Fix 4.0 default for allow dns updates.
       via  0de1675 libcli: Remove uneeded debug message
       via  8b24c43 dns: Delete dnsNode objects when they are empty
      from  553d63f s4-dns: set TTL value in the NS server part of the SOA record

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


- Log -----------------------------------------------------------------
commit 42b0b275059f9c98b9bf417f2048fdc973449def
Author: Michael Wood <esiotrot at gmail.com>
Date:   Sat Jun 1 10:37:37 2013 +0200

    param_table: Remove misleading allow dns updates options.
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Sat Jun  1 12:46:32 CEST 2013 on sn-devel-104

commit 5528551ea39686194837a8083c85b71dedbe6f0e
Author: Michael Wood <esiotrot at gmail.com>
Date:   Sat Jun 1 10:35:56 2013 +0200

    docs: Avoid mentioning a possibly misleading option.
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 7c4c896eacdeda27559f3bf47861392adeb3e10a
Author: Michael Wood <esiotrot at gmail.com>
Date:   Sat Jun 1 10:34:20 2013 +0200

    WHATSNEW: Fix 4.0 default for allow dns updates.
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0de1675e5d3854c5110ed34029be1e59d17991da
Author: Kai Blin <kai at samba.org>
Date:   Sat Jun 1 10:24:12 2013 +0200

    libcli: Remove uneeded debug message
    
    Signed-off-by: Kai Blin <kai at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8b24c43b382740106474e26dec59e1419ba77306
Author: Kai Blin <kai at samba.org>
Date:   Sat Jun 1 10:24:11 2013 +0200

    dns: Delete dnsNode objects when they are empty
    
    If an update leaves the dnsNode without any entries, the dnsNode object
    should be deleted. Thanks to Günter Kukkukk for his excellent debugging
    work on this one.
    
    This should fix bug #9559
    
    Signed-off-by: Kai Blin <kai at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 WHATSNEW.txt                                   |    2 +-
 docs-xml/smbdotconf/domain/allowdnsupdates.xml |    4 +-
 lib/param/param_table.c                        |    5 -
 lib/util/util.c                                |    1 -
 python/samba/tests/dns.py                      |  117 ++++++++++++++++++++++++
 source4/dns_server/dns_utils.c                 |    8 ++-
 6 files changed, 127 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index f1089db..25bd1ab 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -105,7 +105,7 @@ smb.conf changes
    Parameter Name			Description	Default
    --------------			-----------	-------
 
-   allow dns updates			New		disabled
+   allow dns updates			New		secure only
    announce as				Removed
    announce version			Removed
    cldap port				New		0
diff --git a/docs-xml/smbdotconf/domain/allowdnsupdates.xml b/docs-xml/smbdotconf/domain/allowdnsupdates.xml
index fc7d3e8..1563d29 100644
--- a/docs-xml/smbdotconf/domain/allowdnsupdates.xml
+++ b/docs-xml/smbdotconf/domain/allowdnsupdates.xml
@@ -8,8 +8,8 @@
 
 	<para>DNS updates can either be disallowed completely by setting it to
 		<constant>disabled</constant>, enabled over secure connections only by
-		setting it to <constant>secure</constant> or allowed in all cases
-		by setting it to <constant>enabled</constant> or <constant>nonsecure</constant>.
+		setting it to <constant>secure only</constant> or allowed in all cases
+		by setting it to <constant>nonsecure</constant>.
 	</para>
 </description>
 
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 833d3ca..7ff9d0c 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -118,11 +118,6 @@ static const struct enum_list enum_dns_update_settings[] = {
 	{DNS_UPDATE_OFF, "Off"},
 	{DNS_UPDATE_ON, "nonsecure and secure"},
 	{DNS_UPDATE_ON, "nonsecure"},
-	{DNS_UPDATE_ON, "Yes"},
-	{DNS_UPDATE_ON, "True"},
-	{DNS_UPDATE_ON, "1"},
-	{DNS_UPDATE_ON, "On"},
-	{DNS_UPDATE_ON, "enabled"},
 	{DNS_UPDATE_SIGNED, "secure only"},
 	{DNS_UPDATE_SIGNED, "secure"},
 	{DNS_UPDATE_SIGNED, "signed"},
diff --git a/lib/util/util.c b/lib/util/util.c
index 7c669fb..f0ed7f6 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -526,7 +526,6 @@ _PUBLIC_ void dump_data_dbgc(int dbgc_class, int level, const uint8_t *buf, int
 	struct debug_channel_level dcl = { dbgc_class, level };
 
 	if (!DEBUGLVLC(dbgc_class, level)) {
-		DEBUG(0, ("dbgc_class is %d\n", dbgc_class));
 		return;
 	}
 	dump_data_cb(buf, len, false, debugadd_channel_cb, &dcl);
diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py
index 15672a0..0ac9cf4 100644
--- a/python/samba/tests/dns.py
+++ b/python/samba/tests/dns.py
@@ -534,6 +534,123 @@ class TestDNSUpdates(DNSTest):
         response = self.dns_transaction_udp(p)
         self.assert_dns_rcode_equals(response, dns.DNS_RCODE_NXDOMAIN)
 
+    def test_readd_record(self):
+        "Test if adding, deleting and then readding a records works"
+
+        NAME = "readdrec.%s" % self.get_dns_domain()
+
+        # Create the record
+        p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
+        updates = []
+
+        name = self.get_dns_domain()
+
+        u = self.make_name_question(name, dns.DNS_QTYPE_SOA, dns.DNS_QCLASS_IN)
+        updates.append(u)
+        self.finish_name_packet(p, updates)
+
+        updates = []
+        r = dns.res_rec()
+        r.name = NAME
+        r.rr_type = dns.DNS_QTYPE_TXT
+        r.rr_class = dns.DNS_QCLASS_IN
+        r.ttl = 900
+        r.length = 0xffff
+        rdata = dns.txt_record()
+        rdata.txt = '"This is a test"'
+        r.rdata = rdata
+        updates.append(r)
+        p.nscount = len(updates)
+        p.nsrecs = updates
+
+        response = self.dns_transaction_udp(p)
+        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+
+        # Now check the record is around
+        p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+        questions = []
+        q = self.make_name_question(NAME, dns.DNS_QTYPE_TXT, dns.DNS_QCLASS_IN)
+        questions.append(q)
+
+        self.finish_name_packet(p, questions)
+        response = self.dns_transaction_udp(p)
+        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+
+        # Now delete the record
+        p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
+        updates = []
+
+        name = self.get_dns_domain()
+
+        u = self.make_name_question(name, dns.DNS_QTYPE_SOA, dns.DNS_QCLASS_IN)
+        updates.append(u)
+        self.finish_name_packet(p, updates)
+
+        updates = []
+        r = dns.res_rec()
+        r.name = NAME
+        r.rr_type = dns.DNS_QTYPE_TXT
+        r.rr_class = dns.DNS_QCLASS_NONE
+        r.ttl = 0
+        r.length = 0xffff
+        rdata = dns.txt_record()
+        rdata.txt = '"This is a test"'
+        r.rdata = rdata
+        updates.append(r)
+        p.nscount = len(updates)
+        p.nsrecs = updates
+
+        response = self.dns_transaction_udp(p)
+        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+
+        # check it's gone
+        p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+        questions = []
+
+        q = self.make_name_question(NAME, dns.DNS_QTYPE_TXT, dns.DNS_QCLASS_IN)
+        questions.append(q)
+
+        self.finish_name_packet(p, questions)
+        response = self.dns_transaction_udp(p)
+        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_NXDOMAIN)
+
+        # recreate the record
+        p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
+        updates = []
+
+        name = self.get_dns_domain()
+
+        u = self.make_name_question(name, dns.DNS_QTYPE_SOA, dns.DNS_QCLASS_IN)
+        updates.append(u)
+        self.finish_name_packet(p, updates)
+
+        updates = []
+        r = dns.res_rec()
+        r.name = NAME
+        r.rr_type = dns.DNS_QTYPE_TXT
+        r.rr_class = dns.DNS_QCLASS_IN
+        r.ttl = 900
+        r.length = 0xffff
+        rdata = dns.txt_record()
+        rdata.txt = '"This is a test"'
+        r.rdata = rdata
+        updates.append(r)
+        p.nscount = len(updates)
+        p.nsrecs = updates
+
+        response = self.dns_transaction_udp(p)
+        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+
+        # Now check the record is around
+        p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+        questions = []
+        q = self.make_name_question(NAME, dns.DNS_QTYPE_TXT, dns.DNS_QCLASS_IN)
+        questions.append(q)
+
+        self.finish_name_packet(p, questions)
+        response = self.dns_transaction_udp(p)
+        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+
     def test_update_add_mx_record(self):
         "test adding MX records works"
         p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
diff --git a/source4/dns_server/dns_utils.c b/source4/dns_server/dns_utils.c
index 21c7f5a..72782cf 100644
--- a/source4/dns_server/dns_utils.c
+++ b/source4/dns_server/dns_utils.c
@@ -276,7 +276,13 @@ WERROR dns_replace_records(struct dns_server *dns,
 		if (needs_add) {
 			return WERR_OK;
 		}
-		/* TODO: Delete object? */
+		/* No entries left, delete the dnsNode object */
+		ret = ldb_delete(dns->samdb, msg->dn);
+		if (ret != LDB_SUCCESS) {
+			DEBUG(0, ("Deleting record failed; %d\n", ret));
+			return DNS_ERR(SERVER_FAILURE);
+		}
+		return WERR_OK;
 	}
 
 	if (needs_add) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list