From 5cc3843b86a1359190a58c7f6b27f79a9dc9ce7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Kr=C3=BCger?= Date: Tue, 13 Mar 2018 19:47:47 +0100 Subject: [PATCH] Properly escape domains --- acme.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/acme.sh b/acme.sh index 2a3138cb..35f15bab 100755 --- a/acme.sh +++ b/acme.sh @@ -3018,11 +3018,17 @@ _on_before_issue() { _debug Le_LocalAddress "$_chk_local_addr" - alldomains=$(echo "$_chk_main_domain,$_chk_alt_domains" | tr ',' ' ') + remainingdomains="$_chk_main_domain,$_chk_alt_domains" _index=1 _currentRoot="" _addrIndex=1 - for d in $alldomains; do + while [ "$remainingdomains" ]; do + d="${remainingdomains%%,*}" + if [ "$remainingdomains" = "$d" ]; then + remainingdomains="" + else + remainingdomains="${remainingdomains#*,}" + fi _debug "Check for domain" "$d" _currentRoot="$(_getfield "$_chk_web_roots" $_index)" _debug "_currentRoot" "$_currentRoot" @@ -3609,10 +3615,16 @@ $_authorizations_map" _debug2 _authorizations_map "$_authorizations_map" fi - alldomains=$(echo "$_main_domain,$_alt_domains" | tr ',' ' ') + remainingdomains="$_main_domain,$_alt_domains" _index=0 _currentRoot="" - for d in $alldomains; do + while [ "$remainingdomains" ]; do + d="${remainingdomains%%,*}" + if [ "$remainingdomains" = "$d" ]; then + remainingdomains="" + else + remainingdomains="${remainingdomains#*,}" + fi _info "Getting webroot for domain" "$d" _index=$(_math $_index + 1) _w="$(echo $_web_roots | cut -d , -f $_index)"