mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-08 14:05:25 +02:00
disable globbing globally (only allow for cleanup routine)
This commit is contained in:
+5
-7
@@ -8,8 +8,8 @@
|
|||||||
set -e
|
set -e
|
||||||
set -u
|
set -u
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
[[ -n "${ZSH_VERSION:-}" ]] && set -o SH_WORD_SPLIT && set +o FUNCTION_ARGZERO && set -o NULL_GLOB
|
[[ -n "${ZSH_VERSION:-}" ]] && set -o SH_WORD_SPLIT && set +o FUNCTION_ARGZERO && set -o NULL_GLOB && set -o noglob
|
||||||
[[ -z "${ZSH_VERSION:-}" ]] && shopt -s nullglob
|
[[ -z "${ZSH_VERSION:-}" ]] && shopt -s nullglob && set -f
|
||||||
|
|
||||||
umask 077 # paranoid umask, we're creating private keys
|
umask 077 # paranoid umask, we're creating private keys
|
||||||
|
|
||||||
@@ -1087,9 +1087,7 @@ command_sign_domains() {
|
|||||||
# Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire
|
# Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire
|
||||||
ORIGIFS="${IFS}"
|
ORIGIFS="${IFS}"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
[[ -n "${ZSH_VERSION:-}" ]] && set -o noglob || set -f
|
|
||||||
for line in $(<"${DOMAINS_TXT}" tr -d '\r' | awk '{print tolower($0)}' | _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' -e 's/([^ ])>/\1 >/g' -e 's/> />/g' | (grep -vE '^(#|$)' || true)); do
|
for line in $(<"${DOMAINS_TXT}" tr -d '\r' | awk '{print tolower($0)}' | _sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' -e 's/[[:space:]]+/ /g' -e 's/([^ ])>/\1 >/g' -e 's/> />/g' | (grep -vE '^(#|$)' || true)); do
|
||||||
[[ -n "${ZSH_VERSION:-}" ]] && set +o noglob || set +f
|
|
||||||
reset_configvars
|
reset_configvars
|
||||||
IFS="${ORIGIFS}"
|
IFS="${ORIGIFS}"
|
||||||
alias="$(grep -Eo '>[^ ]+' <<< "${line}" || true)"
|
alias="$(grep -Eo '>[^ ]+' <<< "${line}" || true)"
|
||||||
@@ -1201,14 +1199,12 @@ command_sign_domains() {
|
|||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
if [[ ! "${skip}" = "yes" ]]; then
|
if [[ ! "${skip}" = "yes" ]]; then
|
||||||
update_ocsp="yes"
|
update_ocsp="yes"
|
||||||
[[ -n "${ZSH_VERSION:-}" ]] && set -o noglob || set -f
|
|
||||||
if [[ "${PARAM_KEEP_GOING:-}" = "yes" ]]; then
|
if [[ "${PARAM_KEEP_GOING:-}" = "yes" ]]; then
|
||||||
sign_domain "${certdir}" ${domain} ${morenames} &
|
sign_domain "${certdir}" ${domain} ${morenames} &
|
||||||
wait $! || true
|
wait $! || true
|
||||||
else
|
else
|
||||||
sign_domain "${certdir}" ${domain} ${morenames}
|
sign_domain "${certdir}" ${domain} ${morenames}
|
||||||
fi
|
fi
|
||||||
[[ -n "${ZSH_VERSION:-}" ]] && set +o noglob || set +f
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${OCSP_FETCH}" = "yes" ]]; then
|
if [[ "${OCSP_FETCH}" = "yes" ]]; then
|
||||||
@@ -1235,7 +1231,6 @@ command_sign_domains() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
[[ -n "${ZSH_VERSION:-}" ]] && set +o noglob || set +f
|
|
||||||
reset_configvars
|
reset_configvars
|
||||||
|
|
||||||
# remove temporary domains.txt file if used
|
# remove temporary domains.txt file if used
|
||||||
@@ -1344,6 +1339,9 @@ command_cleanup() {
|
|||||||
mkdir "${BASEDIR}/archive"
|
mkdir "${BASEDIR}/archive"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Allow globbing
|
||||||
|
[[ -n "${ZSH_VERSION:-}" ]] && set +o noglob || set +f
|
||||||
|
|
||||||
# Loop over all certificate directories
|
# Loop over all certificate directories
|
||||||
for certdir in "${CERTDIR}/"*; do
|
for certdir in "${CERTDIR}/"*; do
|
||||||
# Skip if entry is not a folder
|
# Skip if entry is not a folder
|
||||||
|
|||||||
Reference in New Issue
Block a user