Skip to content

Commit 05ef9f9

Browse files
authored
Merge pull request #1972 from drwetter/fix_dig-r
Fix cases where dig -r wasn't working
2 parents ad3f7c3 + bc742e0 commit 05ef9f9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

testssl.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20106,6 +20106,7 @@ get_local_a() {
2010620106
check_resolver_bins() {
2010720107
local saved_openssl_conf="$OPENSSL_CONF"
2010820108

20109+
OPENSSL_CONF="" # see https://github.com/drwetter/testssl.sh/issues/134
2010920110
type -p dig &> /dev/null && HAS_DIG=true
2011020111
type -p host &> /dev/null && HAS_HOST=true
2011120112
type -p drill &> /dev/null && HAS_DRILL=true
@@ -20115,19 +20116,15 @@ check_resolver_bins() {
2011520116
type -p idn2 &>/dev/null && HAS_IDN2=true
2011620117

2011720118
# Old dig versions don't have an option to ignore $HOME/.digrc
20118-
if dig -r 2>&1 | grep -qiE 'invalid|usage'; then
20119+
if ! dig -h | grep -qE '\-r.*~/.digrc'; then
2011920120
HAS_DIG_R=false
2012020121
DIG_R=""
2012120122
fi
20122-
20123-
OPENSSL_CONF="" # see https://github.com/drwetter/testssl.sh/issues/134
2012420123
if ! "$HAS_DIG" && ! "$HAS_HOST" && ! "$HAS_DRILL" && ! "$HAS_NSLOOKUP"; then
2012520124
fatal "Neither \"dig\", \"host\", \"drill\" or \"nslookup\" is present" $ERR_DNSBIN
2012620125
fi
2012720126
if "$HAS_DIG"; then
20128-
if dig $DIG_R +noidnout -t a 2>&1 | grep -Eq 'Invalid option: \+noidnout|IDN support not enabled'; then
20129-
:
20130-
else
20127+
if dig -h | grep -Eq idnout; then
2013120128
HAS_DIG_NOIDNOUT=true
2013220129
fi
2013320130
fi

0 commit comments

Comments
 (0)