Merge branch 'TinCanTech-always-warn-unsupp-chars'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
commit
fef28007f3
@ -3850,13 +3850,8 @@ file. Storing sensitive information in the configuration file is not
|
|||||||
recommended - please remove it from there before continuing."
|
recommended - please remove it from there before continuing."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Sanitize vars further but ONLY if it is in PKI folder
|
# Warning: Unsupported characters
|
||||||
if [ "$vars_in_pki" ]; then
|
if grep '^[[:blank:]]*set_var[[:blank:]][[:blank:]]*.*' "$vars" |
|
||||||
# Warning: Unsupported characters
|
|
||||||
if
|
|
||||||
grep \
|
|
||||||
'^[[:blank:]]*set_var[[:blank:]][[:blank:]]*.*' \
|
|
||||||
"$vars" |
|
|
||||||
grep \
|
grep \
|
||||||
-e "EASYRSA_REQ_COUNTRY" \
|
-e "EASYRSA_REQ_COUNTRY" \
|
||||||
-e "EASYRSA_REQ_PROVINCE" \
|
-e "EASYRSA_REQ_PROVINCE" \
|
||||||
@ -3864,13 +3859,11 @@ recommended - please remove it from there before continuing."
|
|||||||
-e "EASYRSA_REQ_ORG" \
|
-e "EASYRSA_REQ_ORG" \
|
||||||
-e "EASYRSA_REQ_EMAIL" \
|
-e "EASYRSA_REQ_EMAIL" \
|
||||||
-e "EASYRSA_REQ_OU" |
|
-e "EASYRSA_REQ_OU" |
|
||||||
grep \
|
grep -q -e '`' -e '{' -e '}'
|
||||||
-q -e '`' -e '$' -e '{' -e '}'
|
then
|
||||||
then
|
warn 'Unsupported characters are present in the vars file.
|
||||||
warn 'Unsupported characters are present in the vars file.
|
These characters are not supported: (`) "{" "}"
|
||||||
These characters are not supported: (`) "$" "{" "}"
|
|
||||||
Sourcing the vars file and building certificates will probably fail ..'
|
Sourcing the vars file and building certificates will probably fail ..'
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable sourcing 'vars'
|
# Enable sourcing 'vars'
|
||||||
@ -3879,12 +3872,13 @@ Sourcing the vars file and building certificates will probably fail ..'
|
|||||||
|
|
||||||
# Test souring 'vars' in a subshell
|
# Test souring 'vars' in a subshell
|
||||||
# shellcheck disable=1090 # can't follow non-constant source. vars
|
# shellcheck disable=1090 # can't follow non-constant source. vars
|
||||||
( . "$vars" ) || die "\
|
( . "$vars" ) || die "Failed to source the vars file."
|
||||||
Failed to source the vars file, remove any unsupported characters."
|
|
||||||
|
|
||||||
# Source 'vars' now
|
# Source 'vars' now
|
||||||
# shellcheck disable=1090 # can't follow non-constant source. vars
|
# shellcheck disable=1090 # can't follow non-constant source. vars
|
||||||
. "$vars" 2>/dev/null
|
. "$vars" 2>/dev/null
|
||||||
|
unset -v EASYRSA_CALLER
|
||||||
|
|
||||||
information "Using Easy-RSA configuration from: $vars"
|
information "Using Easy-RSA configuration from: $vars"
|
||||||
|
|
||||||
if [ "$vars_in_pki" ] || [ "$user_vars_true" ]; then
|
if [ "$vars_in_pki" ] || [ "$user_vars_true" ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user