BIND 10 master, updated. 89071a214099a1de3ce7253e4f91fa4bc8d00272 Changelog for #1782
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Apr 17 08:59:46 UTC 2012
The branch, master has been updated
via 89071a214099a1de3ce7253e4f91fa4bc8d00272 (commit)
via 36efa7d10ecc4efd39d2ce4dfffa0cbdeffa74b0 (commit)
via 3057455dd008c612f64fd265a957bdf9c0b58679 (commit)
via 65193e8384b25f0092177adb91a8ee6c2679d2db (commit)
from 149ac337e9a8e43896e84268a462463429061aed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 89071a214099a1de3ce7253e4f91fa4bc8d00272
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Apr 17 10:47:36 2012 +0200
Changelog for #1782
commit 36efa7d10ecc4efd39d2ce4dfffa0cbdeffa74b0
Merge: 149ac337e9a8e43896e84268a462463429061aed 3057455dd008c612f64fd265a957bdf9c0b58679
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Apr 17 10:46:08 2012 +0200
Merge #1782
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++-
src/lib/datasrc/sqlite3_accessor.cc | 15 ++++++-
src/lib/datasrc/tests/sqlite3_accessor_unittest.cc | 43 ++++++++++++++++++++
3 files changed, 61 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index d1a0ad2..dd46164 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-425. [func]* muks
+426. [bug] vorner
+ The NSEC3 records are now included when transferring a signed zone out.
+ (Trac #1782, git 36efa7d10ecc4efd39d2ce4dfffa0cbdeffa74b0)
+
+425. [func]* muks
Don't autostart b10-auth, b10-xfrin, b10-xfrout and b10-zonemgr in
the default configuration.
(Trac #1818, git 31de885ba0409f54d9a1615eff5a4b03ed420393)
diff --git a/src/lib/datasrc/sqlite3_accessor.cc b/src/lib/datasrc/sqlite3_accessor.cc
index 11f364e..0214762 100644
--- a/src/lib/datasrc/sqlite3_accessor.cc
+++ b/src/lib/datasrc/sqlite3_accessor.cc
@@ -93,8 +93,19 @@ const char* const text_statements[NUM_STATEMENTS] = {
"VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)",
"DELETE FROM records WHERE zone_id=?1 AND name=?2 " // DEL_RECORD
"AND rdtype=?3 AND rdata=?4",
- "SELECT rdtype, ttl, sigtype, rdata, name FROM records " // ITERATE
- "WHERE zone_id = ?1 ORDER BY rname, rdtype",
+ // The following iterates the whole zone. As the NSEC3 records
+ // (and corresponding RRSIGs) live in separate table, we need to
+ // take both of them. As the RRSIGs are for NSEC3s in the other
+ // table, we can easily hardcode the sigtype.
+ //
+ // The extra column is so we can order it by rname. This is to
+ // preserve the previous order, mostly for tests.
+ // TODO: Is it possible to get rid of the ordering?
+ "SELECT rdtype, ttl, sigtype, rdata, name, rname FROM records " // ITERATE
+ "WHERE zone_id = ?1 "
+ "UNION "
+ "SELECT rdtype, ttl, \"NSEC3\", rdata, owner, owner FROM nsec3 "
+ "WHERE zone_id = ?1 ORDER by rname, rdtype",
/*
* This one looks for previous name with NSEC record. It is done by
* using the reversed name. The NSEC is checked because we need to
diff --git a/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc b/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc
index c36c94b..f3aea4e 100644
--- a/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc
+++ b/src/lib/datasrc/tests/sqlite3_accessor_unittest.cc
@@ -194,6 +194,49 @@ TEST_F(SQLite3AccessorTest, iterator) {
EXPECT_FALSE(context->getNext(data));
}
+// This tests the iterator through the whole zone returns NSEC3 records as
+// well. We test this specifically, as it lives in separate table and needs
+// extra handling.
+TEST_F(SQLite3AccessorTest, nsec3Iterator) {
+ // Get the zone
+ const std::pair<bool, int>
+ zone_info(accessor->getZone("sql2.example.com."));
+ ASSERT_TRUE(zone_info.first);
+
+ // Iterate through it
+ DatabaseAccessor::IteratorContextPtr
+ context(accessor->getAllRecords(zone_info.second));
+
+ // We just pick a random NSEC3 to check, the check of complete iterator
+ // is in the above test. In addition, we count the number of NSEC3, RRSIG
+ // and all records, as some kind of check it returns all the data.
+ std::string data[DatabaseAccessor::COLUMN_COUNT];
+
+ size_t nsec3count(0), rrsigcount(0), recordcount(0);
+ bool nsec3match(false);
+ while (context->getNext(data)) {
+ if (data[DatabaseAccessor::TYPE_COLUMN] == "NSEC3") {
+ nsec3count ++;
+ if (data[DatabaseAccessor::NAME_COLUMN] ==
+ "1BB7SO0452U1QHL98UISNDD9218GELR5.sql2.example.com.") {
+ nsec3match = true;
+ EXPECT_EQ("7200", data[DatabaseAccessor::TTL_COLUMN]);
+ EXPECT_EQ("1 0 10 FEEDABEE 4KLSVDE8KH8G95VU68R7AHBE1CPQN38J",
+ data[DatabaseAccessor::RDATA_COLUMN]);
+ }
+ } else if (data[DatabaseAccessor::TYPE_COLUMN] == "RRSIG") {
+ rrsigcount ++;
+ }
+ recordcount ++;
+ }
+
+ // We counted everything now, so check there's nothing else to count
+ EXPECT_EQ(11, nsec3count);
+ EXPECT_EQ(22, rrsigcount);
+ EXPECT_EQ(46, recordcount);
+ EXPECT_TRUE(nsec3match) << "No NSEC3 found when iterating the zone";
+}
+
// This tests getting NSEC3 records
TEST_F(SQLite3AccessorTest, nsec3) {
const std::pair<bool, int>
More information about the bind10-changes
mailing list