Browse Source

Merge pull request #631 from srvrco/timkimber/issue630

Use -r option for dig to force default dig output
pull/638/head
Tim Kimber 5 years ago
committed by GitHub
parent
commit
db008f49af
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 9 deletions
  1. +16
    -7
      getssl
  2. +4
    -2
      test/15-test-revoke-no-suffix.bats

+ 16
- 7
getssl View File

@ -249,6 +249,10 @@
# 2020-12-22 Check that dig doesn't return an error (#611)(2.32)
# 2020-12-29 Fix dig SOA lookup (#617)(2.33)
# 2021-01-05 Show error if running in POSIX mode (#611)
# 2021-01-16 Fix double slash when using root directory with DAVS (ionos)
# 2021-01-22 Add FTP_OPTIONS
# 2021-01-27 Add the ability to set several reload commands (atisne)
# 2021-01-29 Use dig -r (if supported) to ignore.digrc (#630)
# ----------------------------------------------------------------------------------------
case :$SHELLOPTS: in
@ -1119,8 +1123,13 @@ find_dns_utils() {
debug "HAS DIG_OR_DRILL=drill"
HAS_DIG_OR_DRILL="drill"
elif [[ -n "$(command -v dig 2>/dev/null)" ]] && dig >/dev/null 2>&1; then
debug "HAS DIG_OR_DRILL=dig"
HAS_DIG_OR_DRILL="dig"
if [[ $(dig -r >/dev/null 2>&1) ]]; then
# use dig -r so ~/.digrc is not used
HAS_DIG_OR_DRILL="dig -r"
else
HAS_DIG_OR_DRILL="dig"
fi
debug "HAS DIG_OR_DRILL=$HAS_DIG_OR_DRILL"
fi
if [[ -n "$(command -v host 2>/dev/null)" ]]; then
@ -1338,14 +1347,14 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n
# Use SOA +trace to find the name server
if [[ $_TEST_SKIP_SOA_CALL == 0 ]]; then
if [[ "$HAS_DIG_OR_DRILL" == "dig" ]]; then
debug Using "$HAS_DIG_OR_DRILL SOA +trace +nocomments $gad_d $gad_s" to find primary nameserver
test_output "Using $HAS_DIG_OR_DRILL SOA"
res=$($HAS_DIG_OR_DRILL SOA +trace +nocomments "$gad_d" $gad_s 2>/dev/null | grep "IN\WNS\W")
else
if [[ "$HAS_DIG_OR_DRILL" == "drill" ]]; then
debug Using "$HAS_DIG_OR_DRILL -T $gad_d $gad_s" to find primary nameserver
test_output "Using $HAS_DIG_OR_DRILL SOA"
res=$($HAS_DIG_OR_DRILL -T SOA "$gad_d" $gad_s 2>/dev/null | grep "IN\WNS\W")
else
debug Using "$HAS_DIG_OR_DRILL SOA +trace +nocomments $gad_d $gad_s" to find primary nameserver
test_output "Using $HAS_DIG_OR_DRILL SOA"
res=$($HAS_DIG_OR_DRILL SOA +trace +nocomments "$gad_d" $gad_s 2>/dev/null | grep "IN\WNS\W")
fi
fi


+ 4
- 2
test/15-test-revoke-no-suffix.bats View File

@ -19,11 +19,13 @@ setup() {
else
CONFIG_FILE="getssl-http01-no-suffix.cfg"
fi
echo 'CA="https://acme-staging-v02.api.letsencrypt.org"' >> ${INSTALL_DIR}/.getssl/${GETSSL_CMD_HOST}/getssl_test_specific.cfg
. "${CODE_DIR}/test/test-config/${CONFIG_FILE}"
setup_environment
init_getssl
echo 'CA="https://acme-staging-v02.api.letsencrypt.org"' > ${INSTALL_DIR}/.getssl/${GETSSL_CMD_HOST}/getssl_test_specific.cfg
create_certificate
assert_success
check_output_for_errors
@ -36,7 +38,7 @@ setup() {
else
CONFIG_FILE="getssl-http01.cfg"
fi
echo 'CA="https://acme-staging-v02.api.letsencrypt.org"' >> ${INSTALL_DIR}/.getssl/${GETSSL_CMD_HOST}/getssl_test_specific.cfg
echo 'CA="https://acme-staging-v02.api.letsencrypt.org"' > ${INSTALL_DIR}/.getssl/${GETSSL_CMD_HOST}/getssl_test_specific.cfg
. "${CODE_DIR}/test/test-config/${CONFIG_FILE}"
CERT=${INSTALL_DIR}/.getssl/${GETSSL_CMD_HOST}/${GETSSL_CMD_HOST}.crt


Loading…
Cancel
Save