[master] rebuild resigning heaps when loading map files

3597.	[bug]		Ensure automatic-resigning heaps are reconstructed
			when loading zones in map format. [RT #33381]
This commit is contained in:
Evan Hunt
2013-06-14 10:16:10 -07:00
parent 8f1e278931
commit b7e40659ef
14 changed files with 166 additions and 53 deletions

View File

@@ -21,7 +21,7 @@ rm -f ns1/example.db.raw*
rm -f ns1/example.db.compat
rm -f ns1/example.db.serial.raw
rm -f ns1/large.db ns1/large.db.raw
rm -f ns1/example.db.map
rm -f ns1/example.db.map ns1/signed.db.map
rm -f dig.out.*
rm -f dig.out
rm -f */named.memstats
@@ -32,3 +32,6 @@ rm -f ns2/db-*
rm -f ns2/large.bk
rm -f ns3/example.db.map ns3/dynamic.db.map
rm -f baseline.txt text.1 text.2 raw.1 raw.2 map.1 map.2 map.5 text.5 badmap
rm -f ns1/Ksigned.* ns1/dsset-signed. ns1/signed.db.signed
rm -f random.data
rm -f rndc.out

View File

@@ -14,6 +14,10 @@
# $Id$
SYSTEMTESTTOP=../..
. $SYSTEMTESTTOP/conf.sh
RANDFILE=../random.data
../named-compilezone -D -F raw -o example.db.raw example \
example.db > /dev/null 2>&1
../named-compilezone -D -F map -o ../ns3/example.db.map example \
@@ -30,3 +34,7 @@
../named-compilezone -D -F map -o example.db.map example-map \
example.db > /dev/null 2>&1
$KEYGEN -q -r $RANDFILE signed > /dev/null 2>&1
$KEYGEN -q -r $RANDFILE -fk signed > /dev/null 2>&1
$SIGNER -S -f signed.db.signed -o signed signed.db > /dev/null 2>&1
../named-compilezone -D -F map -o signed.db.map signed signed.db.signed > /dev/null 2>&1

View File

@@ -30,6 +30,15 @@ options {
dnssec-enable yes;
};
key rndc_key {
secret "1234abcd8765";
algorithm hmac-sha256;
};
controls {
inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
};
zone "example" {
type master;
masterfile-format raw;
@@ -66,3 +75,12 @@ zone "large" {
masterfile-format raw;
allow-transfer { any; };
};
zone "signed" {
type master;
file "signed.db.map";
masterfile-format map;
allow-transfer { any; };
update-policy local;
auto-dnssec maintain;
};

View File

@@ -0,0 +1,32 @@
; Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
$TTL 1D
@ IN SOA ns hostmaster (
1
3600
1800
1814400
3
)
NS ns
ns A 10.53.0.1
mx MX 10 mail
a A 10.53.0.1
A 10.53.0.2
aaaa AAAA 2001:db8::53
cname CNAME cname-target
dname DNAME dname-target
txt TXT "this is text"

View File

@@ -16,6 +16,9 @@
rm -f named-compilezone
ln -s $CHECKZONE named-compilezone
../../../tools/genrandom 400 random.data
rm -f ns1/example.db.raw
cp ns1/example.db ns2/
cp ns2/formerly-text.db.in ns2/formerly-text.db

View File

@@ -255,5 +255,24 @@ stomp badmap 2897 5 127
[ $ret -eq 0 ] || echo "I:failed"
status=`expr $status + $ret`
echo "I:checking map format zone is scheduled for resigning (compilezone)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus signed > rndc.out 2>&1 || ret=1
grep 'next resign' rndc.out > /dev/null 2>&1 || ret=1
[ $ret -eq 0 ] || echo "I:failed"
status=`expr $status + $ret`
echo "I:checking map format zone is scheduled for resigning (signzone)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 freeze signed > rndc.out 2>&1 || ret=1
cd ns1
$SIGNER -S -O map -f signed.db.map -o signed signed.db > /dev/null 2>&1
cd ..
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reload signed > rndc.out 2>&1 || ret=1
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus signed > rndc.out 2>&1 || ret=1
grep 'next resign' rndc.out > /dev/null 2>&1 || ret=1
[ $ret -eq 0 ] || echo "I:failed"
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status