]> 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:09:51 +0000 (12:09 +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.

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 88910f95a34ddf554f506fea122c14cd5b9ccf35..7b9c0e61778f748cdd8e3223e4ffaffde7a352bf 100755 (executable)
@@ -750,9 +750,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