247
247
# 2020-12-18 Wrong SANS when domain contains a minus character (atisne)
248
248
# 2020-12-22 Fixes to get_auth_dns
249
249
# 2020-12-22 Check that dig doesn't return an error (#611)(2.32)
250
+ # 2020-12-29 Fix dig SOA lookup (#617)(2.33)
251
+ # 2021-01-05 Show error if running in POSIX mode (#611)
250
252
# ----------------------------------------------------------------------------------------
251
253
254
+ case :$SHELLOPTS : in
255
+ * :posix:* ) echo -e " ${0##*/ } : Running with POSIX mode enabled is not supported" >&2 ; exit 1;;
256
+ esac
257
+
252
258
PROGNAME=${0##*/ }
253
259
PROGDIR=" $( cd " $( dirname " $0 " ) " || exit ; pwd -P; ) "
254
- VERSION=" 2.32 "
260
+ VERSION=" 2.33 "
255
261
256
262
# defaults
257
263
ACCOUNT_KEY_LENGTH=4096
@@ -766,7 +772,9 @@ check_getssl_upgrade() { # check if a more recent version of code is available a
766
772
getssl_versions=(" ${getssl_versions[@]: 1} " )
767
773
done
768
774
fi
769
- eval " $ORIGCMD "
775
+ if ! eval " $ORIGCMD " ; then
776
+ error_exit " Running upgraded getssl failed"
777
+ fi
770
778
graceful_exit
771
779
else
772
780
info " "
@@ -1310,11 +1318,11 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n
1310
1318
if [[ " $HAS_DIG_OR_DRILL " == " dig" ]]; then
1311
1319
debug Using " $HAS_DIG_OR_DRILL SOA +trace +nocomments $gad_d $gad_s " to find primary nameserver
1312
1320
test_output " Using $HAS_DIG_OR_DRILL SOA"
1313
- res=$( $HAS_DIG_OR_DRILL SOA +trace +nocomments " $gad_d " " $gad_s " 2> /dev/null | grep " IN\WNS\W" )
1321
+ res=$( $HAS_DIG_OR_DRILL SOA +trace +nocomments " $gad_d " $gad_s 2> /dev/null | grep " IN\WNS\W" )
1314
1322
else
1315
1323
debug Using " $HAS_DIG_OR_DRILL -T $gad_d $gad_s " to find primary nameserver
1316
1324
test_output " Using $HAS_DIG_OR_DRILL SOA"
1317
- res=$( $HAS_DIG_OR_DRILL -T SOA " $gad_d " " $gad_s " 2> /dev/null | grep " IN\WNS\W" )
1325
+ res=$( $HAS_DIG_OR_DRILL -T SOA " $gad_d " $gad_s 2> /dev/null | grep " IN\WNS\W" )
1318
1326
fi
1319
1327
fi
1320
1328
@@ -1324,12 +1332,12 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n
1324
1332
1325
1333
# Two options here; either dig CNAME will return the CNAME and the NS or just the CNAME
1326
1334
debug Checking for CNAME using " $HAS_DIG_OR_DRILL CNAME $gad_d $gad_s "
1327
- res=$( $HAS_DIG_OR_DRILL CNAME " $gad_d " " $gad_s " | grep " ^$gad_d " )
1335
+ res=$( $HAS_DIG_OR_DRILL CNAME " $gad_d " $gad_s | grep " ^$gad_d " )
1328
1336
cname=$( echo " $res " | awk ' $4 ~ "CNAME" {print $5}' | sed ' s/\.$//g' )
1329
1337
1330
1338
if [[ $_TEST_SKIP_CNAME_CALL == 0 ]]; then
1331
1339
debug Checking if CNAME result contains NS records
1332
- res=$( $HAS_DIG_OR_DRILL CNAME " $gad_d " " $gad_s " | grep -E " IN\W(NS|SOA)\W" )
1340
+ res=$( $HAS_DIG_OR_DRILL CNAME " $gad_d " $gad_s | grep -E " IN\W(NS|SOA)\W" )
1333
1341
else
1334
1342
res=" "
1335
1343
fi
@@ -1385,7 +1393,8 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n
1385
1393
if [[ -z " $gad_s " ]]; then
1386
1394
res=$( host -t NS " $gad_d " | grep " name server" )
1387
1395
else
1388
- res=$( host -t NS " $gad_d " " $gad_s " | grep " name server" )
1396
+ # shellcheck disable=SC2086
1397
+ res=$( host -t NS " $gad_d " $gad_s | grep " name server" )
1389
1398
fi
1390
1399
if [[ -n " $res " ]]; then
1391
1400
all_auth_dns_servers=$( echo " $res " | awk ' {print $4}' | sed ' s/\.$//g' | tr ' \n' ' ' )
0 commit comments