]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Replace incorrect sed expersion with awk
authorMark Andrews <marka@isc.org>
Mon, 8 Nov 2021 03:05:42 +0000 (14:05 +1100)
committerMark Andrews <marka@isc.org>
Wed, 10 Nov 2021 01:51:03 +0000 (12:51 +1100)
The sed expression could find the wrong instance of 10.
Use awk to replace the TTL field and also to specify the
server and issue the send command.

(cherry picked from commit be879cda728b9fac3208f39148869d46c9c919e7)

bin/tests/system/nsupdate/clean.sh
bin/tests/system/nsupdate/tests.sh

index aa327f89621a711b5515dc540f90dbfd597cfff7..ac3f12f19798951e86fd34d960479e2e6b6b3167 100644 (file)
@@ -63,4 +63,5 @@ rm -f perl.update_test.out
 rm -f nsupdate.out*
 rm -f typelist.out.*
 rm -f update.out.*
+rm -f update.in.*
 rm -f verylarge
index 836927398cda057de5f793da7d68b13ef20baffe..883913139dca6bccb9030926ecbd43f807193b9e 100755 (executable)
@@ -751,9 +751,10 @@ ret=0
 echo_i "check that changes to the DNSKEY RRset TTL do not have side effects ($n)"
 $DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd dnskey.test. \
         @10.53.0.3 dnskey | \
-       sed -n 's/\(.*\)10.IN/update add \1600 IN/p' |
-       (echo server 10.53.0.3 ${PORT}; cat - ; echo send ) |
-$NSUPDATE
+       awk -v port="${PORT}" 'BEGIN { print "server 10.53.0.3", port; }
+       $2 == 10 && $3 == "IN" && $4 == "DNSKEY" { $2 = 600; print "update add", $0 }
+       END { print "send" }' > update.in.$n
+$NSUPDATE update.in.$n
 
 $DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd dnskey.test. \
        @10.53.0.3 any > dig.out.ns3.$n