From 3c13af375900ffe79af4926953799e6123c9d698 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 8 Jul 2014 02:00:28 +1000 Subject: [PATCH] 3892. [bug] Setting '-t aaaa' in .digrc had unintended side effects. [RT #36452] --- CHANGES | 3 +++ bin/dig/dig.c | 3 ++- bin/tests/system/resolver/clean.sh | 1 + bin/tests/system/resolver/prereq.sh | 2 +- bin/tests/system/resolver/tests.sh | 14 ++++++++++++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 567a20a602..1c7a9b3d56 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3892. [bug] Setting '-t aaaa' in .digrc had unintended side + effects. [RT #36452] + 3891. [bug] Use ${INSTALL_SCRIPT} rather than ${INSTALL_PROGRAM} to install python programs. diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 3622d8ff4c..56c90dd5a4 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -1559,7 +1559,8 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, (*lookup)->tcp_mode = ISC_TRUE; } else { (*lookup)->rdtype = rdtype; - (*lookup)->rdtypeset = ISC_TRUE; + if (!config_only) + (*lookup)->rdtypeset = ISC_TRUE; if (rdtype == dns_rdatatype_axfr) { (*lookup)->section_question = plusquest; (*lookup)->comments = pluscomm; diff --git a/bin/tests/system/resolver/clean.sh b/bin/tests/system/resolver/clean.sh index a721e3f0e5..3632ba8663 100644 --- a/bin/tests/system/resolver/clean.sh +++ b/bin/tests/system/resolver/clean.sh @@ -31,3 +31,4 @@ rm -f ns6/dsset-example.net. ns6/example.net.db.signed.jnl rm -f ns6/to-be-removed.tld.db ns6/to-be-removed.tld.db.jnl rm -f ns7/server.db ns7/server.db.jnl ns7/named.conf rm -f resolve.out +rm -f .digrc diff --git a/bin/tests/system/resolver/prereq.sh b/bin/tests/system/resolver/prereq.sh index 6715213e44..2020ed6d57 100644 --- a/bin/tests/system/resolver/prereq.sh +++ b/bin/tests/system/resolver/prereq.sh @@ -20,7 +20,7 @@ SYSTEMTESTTOP=.. if $PERL -e 'use Net::DNS;' 2>/dev/null then - if $PERL -e 'use Net::DNS; die if ($Net::DNS::VERSION >= 0.76 && $Net::DNS::VERSION <= 0.77);' 2>/dev/null + if $PERL -e 'use Net::DNS; die if ($Net::DNS::VERSION eq "0.76" || $Net::DNS::VERSION eq "0.77");' 2>/dev/null then : else diff --git a/bin/tests/system/resolver/tests.sh b/bin/tests/system/resolver/tests.sh index f697adf373..b80f19c23d 100755 --- a/bin/tests/system/resolver/tests.sh +++ b/bin/tests/system/resolver/tests.sh @@ -486,5 +486,19 @@ grep "query: noedns.fetchall.tld IN ANY +E" ns5/named.run > /dev/null && ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` +n=`expr $n + 1` +echo "I:check that '-t aaaa' in .digrc does not have unexpected side effects ($n)" +ret=0 +echo "-t aaaa" > .digrc +env HOME=`pwd` $DIG @10.53.0.4 -p 5300 . > dig.out.1.${n} || ret=1 +env HOME=`pwd` $DIG @10.53.0.4 -p 5300 . A > dig.out.2.${n} || ret=1 +env HOME=`pwd` $DIG @10.53.0.4 -p 5300 -x 127.0.0.1 > dig.out.3.${n} || ret=1 +grep ';\..*IN.*AAAA$' dig.out.1.${n} > /dev/null || ret=1 +grep ';\..*IN.*A$' dig.out.2.${n} > /dev/null || ret=1 +grep 'extra type option' dig.out.2.${n} > /dev/null && ret=1 +grep ';1\.0\.0\.127\.in-addr\.arpa\..*IN.*PTR$' dig.out.3.${n} > /dev/null || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + echo "I:exit status: $status" exit $status