Commit b5b934a0 authored by Evan Hunt's avatar Evan Hunt
Browse files

2974. [bug] Some vaild UPDATE requests could fail due to a

			consistency check examining the existing version
			of the zone rather than the new version resulting
			from the UPDATE. [RT #22413]
parent d80e5e2d
2974. [bug] Some vaild UPDATE requests could fail due to a
consistency check examining the existing version
of the zone rather than the new version resulting
from the UPDATE. [RT #22413]
2973. [bug] bind.keys.h was being removed by the "make clean"
at the end of configure resulting in build failures
where there is very old version of perl installed.
......
......@@ -15,7 +15,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: clean.sh,v 1.16 2009/10/27 05:57:06 each Exp $
# $Id: clean.sh,v 1.17 2010/11/30 02:27:07 each Exp $
#
# Clean up after zone transfer tests.
......@@ -23,6 +23,7 @@
rm -f dig.out.ns1 dig.out.ns2 dig.out.ns1.after ns1/*.jnl ns2/*.jnl \
ns1/example.db ns1/update.db ns1/other.db ns1/ddns.key
rm -f nsupdate.out
rm -f random.data
rm -f ns2/example.bk
rm -f ns2/update.bk
......
......@@ -15,7 +15,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: tests.sh,v 1.28 2009/09/04 17:14:58 each Exp $
# $Id: tests.sh,v 1.29 2010/11/30 02:27:07 each Exp $
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
......@@ -61,8 +61,8 @@ update add updated.example.nil. 600 TXT Foo
update delete t.example.nil.
END
echo "I:sleeping 15 seconds for server to incorporate changes"
sleep 15
echo "I:sleeping 5 seconds for server to incorporate changes"
sleep 5
echo "I:fetching first copy of zone after update"
$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.nil.\
......@@ -98,6 +98,48 @@ post=`$DIG +short new.other.nil. @10.53.0.1 a -p 5300` || status=1
echo "I:comparing post-update copy to known good data"
$PERL ../digcomp.pl knowngood.ns1.after dig.out.ns1 || status=1
echo "I:testing zone consistency checks"
# inserting an NS record without a corresponding A or AAAA record should fail
$NSUPDATE -l -p 5300 -k ns1/session.key > nsupdate.out 2>&1 << END && status=1
update add other.nil. 600 in ns ns3.other.nil.
send
END
grep REFUSED nsupdate.out > /dev/null 2>&1 || status=1
# ...but should work if an A record is inserted first:
$NSUPDATE -l -p 5300 -k ns1/session.key > nsupdate.out 2>&1 << END || status=1
update add ns4.other.nil 600 in a 10.53.0.1
send
update add other.nil. 600 in ns ns4.other.nil.
send
END
grep REFUSED nsupdate.out > /dev/null 2>&1 && status=1
# ...or if an AAAA record does:
$NSUPDATE -l -p 5300 -k ns1/session.key > nsupdate.out 2>&1 << END || status=1
update add ns5.other.nil 600 in aaaa 2001:db8::1
send
update add other.nil. 600 in ns ns5.other.nil.
send
END
grep REFUSED nsupdate.out > /dev/null 2>&1 && status=1
# ...or if the NS and A/AAAA are inserted together:
$NSUPDATE -l -p 5300 -k ns1/session.key > nsupdate.out 2>&1 << END || status=1
update add other.nil. 600 in ns ns6.other.nil.
update add ns6.other.nil 600 in a 10.53.0.1
send
END
grep REFUSED nsupdate.out > /dev/null 2>&1 && status=1
echo "I:sleeping 5 seconds for server to incorporate changes"
sleep 5
echo "I:checking result of update"
$DIG +short @10.53.0.1 -p 5300 ns other.nil > dig.out.ns1 || status=1
grep ns3.other.nil dig.out.ns1 > /dev/null 2>&1 && status=1
grep ns4.other.nil dig.out.ns1 > /dev/null 2>&1 || status=1
grep ns5.other.nil dig.out.ns1 > /dev/null 2>&1 || status=1
grep ns6.other.nil dig.out.ns1 > /dev/null 2>&1 || status=1
if $PERL -e 'use Net::DNS;' 2>/dev/null
then
echo "I:running update.pl test"
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.574 2010/09/06 04:41:13 marka Exp $ */
/* $Id: zone.c,v 1.575 2010/11/30 02:27:08 each Exp $ */
/*! \file */
......@@ -3639,8 +3639,8 @@ exit_check(dns_zone_t *zone) {
}
static isc_boolean_t
zone_check_ns(dns_zone_t *zone, dns_db_t *db, dns_name_t *name,
isc_boolean_t logit)
zone_check_ns(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *version,
dns_name_t *name, isc_boolean_t logit)
{
isc_result_t result;
char namebuf[DNS_NAME_FORMATSIZE];
......@@ -3660,13 +3660,13 @@ zone_check_ns(dns_zone_t *zone, dns_db_t *db, dns_name_t *name,
dns_fixedname_init(&fixed);
foundname = dns_fixedname_name(&fixed);
result = dns_db_find(db, name, NULL, dns_rdatatype_a,
result = dns_db_find(db, name, version, dns_rdatatype_a,
0, 0, NULL, foundname, NULL, NULL);
if (result == ISC_R_SUCCESS)
return (ISC_TRUE);
if (result == DNS_R_NXRRSET) {
result = dns_db_find(db, name, NULL, dns_rdatatype_aaaa,
result = dns_db_find(db, name, version, dns_rdatatype_aaaa,
0, 0, NULL, foundname, NULL, NULL);
if (result == ISC_R_SUCCESS)
return (ISC_TRUE);
......@@ -3738,7 +3738,7 @@ zone_count_ns_rr(dns_zone_t *zone, dns_db_t *db, dns_dbnode_t *node,
result = dns_rdata_tostruct(&rdata, &ns, NULL);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
if (dns_name_issubdomain(&ns.name, &zone->origin) &&
!zone_check_ns(zone, db, &ns.name, logit))
!zone_check_ns(zone, db, version, &ns.name, logit))
ecount++;
}
count++;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment