Correct indentation
Follow-up to: 9f0d4bf16d044d5e0d3a8e6b17c5eaa9b1bcbc39 Separate commit for clarity. Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
parent
9f0d4bf16d
commit
87e514e3b6
@ -2640,49 +2640,49 @@ Priority should be given to your PKI vars file:
|
|||||||
# END: Find vars
|
# END: Find vars
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If $EASYRSA_NO_VARS is defined (not blank) then do not use vars
|
# If $EASYRSA_NO_VARS is defined (not blank) then do not use vars
|
||||||
# if $no_pki_required then no vars is required.
|
# if $no_pki_required then no vars is required.
|
||||||
if [ "$EASYRSA_NO_VARS" ] || [ "$no_pki_required" ]; then
|
if [ "$EASYRSA_NO_VARS" ] || [ "$no_pki_required" ]; then
|
||||||
|
: # ok
|
||||||
|
else
|
||||||
|
# If a vars file was located then source it
|
||||||
|
if [ -z "$vars" ]; then
|
||||||
|
# $vars remains undefined .. no vars found
|
||||||
: # ok
|
: # ok
|
||||||
else
|
else
|
||||||
# If a vars file was located then source it
|
# Sanitize vars
|
||||||
if [ -z "$vars" ]; then
|
if grep -Eq 'EASYRSA_PASSIN|EASYRSA_PASSOUT' "$vars"; then
|
||||||
# $vars remains undefined .. no vars found
|
die "\
|
||||||
: # ok
|
|
||||||
else
|
|
||||||
# Sanitize vars
|
|
||||||
if grep -Eq 'EASYRSA_PASSIN|EASYRSA_PASSOUT' "$vars"; then
|
|
||||||
die "\
|
|
||||||
Variable EASYRSA_PASSIN or EASYRSA_PASSOUT has been found in the configuration
|
Variable EASYRSA_PASSIN or EASYRSA_PASSOUT has been found in the configuration
|
||||||
file. Storing sensitive information in the configuration file is not
|
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
|
# Sanitize vars further but ONLY if it is in PKI folder
|
||||||
if [ "$pki_vars" ]; then
|
if [ "$pki_vars" ]; then
|
||||||
# Warning: Single quote
|
# Warning: Single quote
|
||||||
if grep '^[[:blank:]]*set_var[[:blank:]]\+.*' "$vars" | \
|
if grep '^[[:blank:]]*set_var[[:blank:]]\+.*' "$vars" | \
|
||||||
grep -q -e '&' -e "'" -e '`' -e '\$' -e '#' ; then
|
grep -q -e '&' -e "'" -e '`' -e '\$' -e '#' ; then
|
||||||
warn "\
|
warn "\
|
||||||
Unsupported characters are present in the vars file.
|
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
|
||||||
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2034 # EASYRSA_CALLER appears unused.
|
# shellcheck disable=SC2034 # EASYRSA_CALLER appears unused.
|
||||||
EASYRSA_CALLER=1
|
EASYRSA_CALLER=1
|
||||||
# shellcheck disable=1090 # can't follow non-constant source. vars
|
# shellcheck disable=1090 # can't follow non-constant source. vars
|
||||||
( . "$vars" 2>/dev/null ) || die "\
|
( . "$vars" 2>/dev/null ) || die "\
|
||||||
Failed to source the vars file, remove any unsupported characters."
|
Failed to source the vars file, remove any unsupported characters."
|
||||||
|
|
||||||
# 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
|
||||||
notice "Using Easy-RSA configuration from: $vars"
|
notice "Using Easy-RSA configuration from: $vars"
|
||||||
[ "$pki_vars" ] || \
|
[ "$pki_vars" ] || \
|
||||||
warn "Move your vars file to your PKI folder, where it is safe!"
|
warn "Move your vars file to your PKI folder, where it is safe!"
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Set defaults, preferring existing env-vars if present
|
# Set defaults, preferring existing env-vars if present
|
||||||
set_var EASYRSA "$PWD"
|
set_var EASYRSA "$PWD"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user