Remove the mastefile-format map option

As previously announced, this commit removes the masterfile-format
format 'map' from named, all the tools, the documentation and the
system tests.
This commit is contained in:
Ondřej Surý
2021-09-16 11:46:13 +02:00
parent 1cc866fdef
commit edee9440d0
67 changed files with 127 additions and 2458 deletions

View File

@@ -13,7 +13,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 ./ns1/signed.db.map
rm -f ./ns1/signed.db.raw
rm -f ./ns1/session.key
rm -f ./dig.out.*
rm -f ./dig.out
@@ -25,8 +25,8 @@ rm -f ./ns2/transfer.db.*
rm -f ./ns2/formerly-text.db
rm -f ./ns2/db-*
rm -f ./ns2/large.bk
rm -f ./ns3/example.db.map ./ns3/dynamic.db.map
rm -f ./baseline.txt ./text.* ./raw.* ./map.* ./badmap
rm -f ./ns3/example.db.raw ./ns3/dynamic.db.raw
rm -f ./baseline.txt ./text.* ./raw.*
rm -f ./ns1/Ksigned.* ./ns1/dsset-signed. ./ns1/signed.db.signed
rm -f ./rndc.out
rm -f ./ns*/named.lock

View File

@@ -14,9 +14,9 @@
$CHECKZONE -D -F raw -o example.db.raw example \
example.db > /dev/null 2>&1
$CHECKZONE -D -F map -o ../ns3/example.db.map example \
$CHECKZONE -D -F raw -o ../ns3/example.db.raw example \
example.db > /dev/null 2>&1
$CHECKZONE -D -F map -o ../ns3/dynamic.db.map dynamic \
$CHECKZONE -D -F raw -o ../ns3/dynamic.db.raw dynamic \
example.db > /dev/null 2>&1
$CHECKZONE -D -F raw=1 -o example.db.raw1 example-explicit \
example.db > /dev/null 2>&1
@@ -25,10 +25,8 @@ $CHECKZONE -D -F raw=0 -o example.db.compat example-compat \
$CHECKZONE -D -F raw -L 3333 -o example.db.serial.raw example \
example.db > /dev/null 2>&1
$CHECKZONE -D -F raw -o large.db.raw large large.db > /dev/null 2>&1
$CHECKZONE -D -F map -o example.db.map example-map \
example.db > /dev/null 2>&1
$KEYGEN -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -f KSK signed > /dev/null 2>&1
$KEYGEN -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" signed > /dev/null 2>&1
$SIGNER -S -f signed.db.signed -o signed signed.db > /dev/null
$CHECKZONE -D -F map -o signed.db.map signed signed.db.signed > /dev/null 2>&1
$CHECKZONE -D -F raw -o signed.db.raw signed signed.db.signed > /dev/null 2>&1

View File

@@ -77,8 +77,8 @@ zone "large" {
zone "signed" {
type primary;
file "signed.db.map";
masterfile-format map;
file "signed.db.raw";
masterfile-format raw;
allow-transfer { any; };
update-policy local;
auto-dnssec maintain;

View File

@@ -31,13 +31,13 @@ controls {
zone "example" {
type primary;
masterfile-format map;
file "example.db.map";
masterfile-format raw;
file "example.db.raw";
};
zone "dynamic" {
type primary;
masterfile-format map;
file "dynamic.db.map";
masterfile-format raw;
file "dynamic.db.raw";
allow-update { any; };
};

View File

@@ -15,15 +15,6 @@
status=0
n=1
ismap () {
# shellcheck disable=SC2016
$PERL -e 'binmode STDIN;
read(STDIN, $input, 8);
($style, $version) = unpack("NN", $input);
exit 1 if ($style != 3 || $version > 1);' < "$1"
return $?
}
israw () {
# shellcheck disable=SC2016
$PERL -e 'binmode STDIN;
@@ -49,7 +40,7 @@ rawversion () {
if (length($input) < 8) { print "not raw\n"; exit 0; };
($style, $version) = unpack("NN", $input);
print ($style == 2 || $style == 3 ? "$version\n" :
"not raw or map\n");' < "$1"
"not raw\n");' < "$1"
}
sourceserial () {
@@ -124,11 +115,9 @@ ret=0
israw ns1/example.db.raw || ret=1
israw ns1/example.db.raw1 || ret=1
israw ns1/example.db.compat || ret=1
ismap ns1/example.db.map || ret=1
[ "$(rawversion ns1/example.db.raw)" -eq 1 ] || ret=1
[ "$(rawversion ns1/example.db.raw1)" -eq 1 ] || ret=1
[ "$(rawversion ns1/example.db.compat)" -eq 0 ] || ret=1
[ "$(rawversion ns1/example.db.map)" -eq 1 ] || ret=1
n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
@@ -199,28 +188,17 @@ n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
echo_i "checking format transitions: text->raw->map->text ($n)"
echo_i "checking format transitions: text->raw->text ($n)"
ret=0
$CHECKZONE -D -f text -F text -o baseline.txt example.nil ns1/example.db > /dev/null
$CHECKZONE -D -f text -F raw -o raw.1 example.nil baseline.txt > /dev/null
$CHECKZONE -D -f raw -F map -o map.1 example.nil raw.1 > /dev/null
$CHECKZONE -D -f map -F text -o text.1 example.nil map.1 > /dev/null
$CHECKZONE -D -f raw -F text -o text.1 example.nil raw.1 > /dev/null
cmp -s baseline.txt text.1 || ret=0
n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
echo_i "checking format transitions: text->map->raw->text ($n)"
ret=0
$CHECKZONE -D -f text -F map -o map.2 example.nil baseline.txt > /dev/null
$CHECKZONE -D -f map -F raw -o raw.2 example.nil map.2 > /dev/null
$CHECKZONE -D -f raw -F text -o text.2 example.nil raw.2 > /dev/null
cmp -s baseline.txt text.2 || ret=0
n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
echo_i "checking map format loading with journal file rollforward ($n)"
echo_i "checking raw format loading with journal file rollforward ($n)"
ret=0
$NSUPDATE <<END > /dev/null || status=1
server 10.53.0.3 ${PORT}
@@ -248,7 +226,7 @@ n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
echo_i "checking map format file dumps correctly ($n)"
echo_i "checking raw format file dumps correctly ($n)"
ret=0
$NSUPDATE <<END > /dev/null || status=1
server 10.53.0.3 ${PORT}
@@ -274,44 +252,7 @@ n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
# stomp on the file header
echo_i "checking corrupt map files fail to load (bad file header) ($n)"
ret=0
$CHECKZONE -D -f text -F map -o map.5 example.nil baseline.txt > /dev/null
cp map.5 badmap
stomp badmap 0 32 99
$CHECKZONE -D -f map -F text -o text.5 example.nil badmap > /dev/null
[ $? = 1 ] || ret=1
n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
# stomp on the file data so it hashes differently.
# these are small and subtle changes, so that the resulting file
# would appear to be a legitimate map file and would not trigger an
# assertion failure if loaded into memory, but should still fail to
# load because of a SHA1 hash mismatch.
echo_i "checking corrupt map files fail to load (bad node header) ($n)"
ret=0
cp map.5 badmap
stomp badmap 2754 2 99
$CHECKZONE -D -f map -F text -o text.5 example.nil badmap > /dev/null
[ $? = 1 ] || ret=1
n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
echo_i "checking corrupt map files fail to load (bad node data) ($n)"
ret=0
cp map.5 badmap
stomp badmap 2897 5 127
$CHECKZONE -D -f map -F text -o text.5 example.nil badmap > /dev/null
[ $? = 1 ] || ret=1
n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
echo_i "checking map format zone is scheduled for resigning (compilezone) ($n)"
echo_i "checking raw format zone is scheduled for resigning (compilezone) ($n)"
ret=0
rndccmd 10.53.0.1 zonestatus signed > rndc.out 2>&1 || ret=1
grep 'next resign' rndc.out > /dev/null 2>&1 || ret=1
@@ -319,10 +260,10 @@ n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
echo_i "checking map format zone is scheduled for resigning (signzone) ($n)"
echo_i "checking raw format zone is scheduled for resigning (signzone) ($n)"
ret=0
rndccmd 10.53.0.1 freeze signed > rndc.out 2>&1 || ret=1
(cd ns1 || exit 1; $SIGNER -S -O map -f signed.db.map -o signed signed.db > /dev/null)
(cd ns1 || exit 1; $SIGNER -S -O raw -f signed.db.raw -o signed signed.db > /dev/null)
rndc_reload ns1 10.53.0.1 signed
rndccmd 10.53.0.1 zonestatus signed > rndc.out 2>&1 || ret=1
grep 'next resign' rndc.out > /dev/null 2>&1 || ret=1
@@ -330,22 +271,5 @@ n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
# The following test is disabled by default because it is very slow.
if [ -n "${TEST_LARGE_MAP}" ]; then
echo_i "checking map file size > 2GB can be loaded ($n)"
ret=0
$PERL ../../startperf/mkzonefile.pl test 9000000 > text.$n
# convert to map
$CHECKZONE -D -f text -F map -o map.$n test text.$n > /dev/null || ret=1
# check map file size is over 2GB to ensure the test is valid
size=$(ls -l map.$n | awk '{print $5}')
[ "$size" -gt 2147483648 ] || ret=1
# convert back to text
$CHECKZONE -f map test map.$n > /dev/null || ret=1
n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
fi
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1