Skip to content

Commit 516cd43

Browse files
authored
Merge pull request #1973 from drwetter/fix_dig-r_3.0
Fix cases where dig -r wasn't working (3.0)
2 parents 30a2f47 + 80cbdf2 commit 516cd43

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

testssl.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17852,6 +17852,7 @@ get_local_a() {
1785217852
check_resolver_bins() {
1785317853
local saved_openssl_conf="$OPENSSL_CONF"
1785417854

17855+
OPENSSL_CONF="" # see https://github.com/drwetter/testssl.sh/issues/134
1785517856
type -p dig &> /dev/null && HAS_DIG=true
1785617857
type -p host &> /dev/null && HAS_HOST=true
1785717858
type -p drill &> /dev/null && HAS_DRILL=true
@@ -17861,19 +17862,15 @@ check_resolver_bins() {
1786117862
type -p idn2 &>/dev/null && HAS_IDN2=true
1786217863

1786317864
# Old dig versions don't have an option to ignore $HOME/.digrc
17864-
if dig -r 2>&1 | grep -qiE 'invalid|usage'; then
17865+
if ! dig -h | grep -qE '\-r.*~/.digrc'; then
1786517866
HAS_DIG_R=false
1786617867
DIG_R=""
1786717868
fi
17868-
17869-
OPENSSL_CONF="" # see https://github.com/drwetter/testssl.sh/issues/134
1787017869
if ! "$HAS_DIG" && ! "$HAS_HOST" && ! "$HAS_DRILL" && ! "$HAS_NSLOOKUP"; then
1787117870
fatal "Neither \"dig\", \"host\", \"drill\" or \"nslookup\" is present" $ERR_DNSBIN
1787217871
fi
1787317872
if "$HAS_DIG"; then
17874-
if dig $DIG_R +noidnout -t a 2>&1 | grep -Eq 'Invalid option: \+noidnout|IDN support not enabled'; then
17875-
:
17876-
else
17873+
if dig -h | grep -Eq idnout; then
1787717874
HAS_DIG_NOIDNOUT=true
1787817875
fi
1787917876
fi

0 commit comments

Comments
 (0)