]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Properly detect presence of CDS/CDNSKEY records
authorMichał Kępień <michal@isc.org>
Mon, 3 Jun 2019 11:43:29 +0000 (13:43 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 3 Jun 2019 11:43:29 +0000 (13:43 +0200)
Replace grep calls with awk scripts to more precisely detect presence of
CDS and CDNSKEY records in a signed zone file, in order to prevent rare
false positives for the "smartsign" system test triggered by the strings
"CDS" and/or "CDNSKEY" being accidentally present in the Base64 form of
DNSSEC-related data in the zone file being checked.

bin/tests/system/smartsign/tests.sh

index ffd9bf09de420903702f9f3684d91e5ee13cca54..8182ce87c8fbda102c59c7acb6e13d2fa35e006b 100644 (file)
@@ -343,8 +343,8 @@ status=`expr $status + $ret`
 
 echo_i "checking sync record publication"
 ret=0
-grep -w CDNSKEY $cfile.signed > /dev/null || ret=1
-grep -w CDS $cfile.signed > /dev/null || ret=1
+awk 'BEGIN { r=1 } $2 == "CDNSKEY" { r=0 } END { exit r }' $cfile.signed || ret=1
+awk 'BEGIN { r=1 } $2 == "CDS" { r=0 } END { exit r }' $cfile.signed || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
@@ -353,8 +353,8 @@ ret=0
 $SETTIME -P now -A now -Dsync now ${cksk5} > /dev/null
 $SIGNER -Sg -o $czone -f $cfile.new $cfile.signed > /dev/null 2>&1
 mv $cfile.new $cfile.signed
-grep -w CDNSKEY $cfile.signed > /dev/null && ret=1
-grep -w CDS $cfile.signed > /dev/null && ret=1
+awk 'BEGIN { r=1 } $2 == "CDNSKEY" { r=0 } END { exit r }' $cfile.signed && ret=1
+awk 'BEGIN { r=1 } $2 == "CDS" { r=0 } END { exit r }' $cfile.signed && ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`