Merge branch 'prohibit-export-in-vars' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-prohibit-export-in-vars

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2023-04-13 23:34:04 +01:00
commit cee79481b3
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -5045,8 +5045,8 @@ Using Easy-RSA configuration:
# Sanitize vars
if grep -q \
-e 'EASYRSA_PASSIN' -e 'EASYRSA_PASSOUT' \
-e '^[^#]*export *_*[[:alpha:]]*[[:alnum:]]*.*$' \
-e '[^(]`[^)]' "$vars"
-e '[^(]`[^)]' \
"$vars"
then
die "\
One or more of these problems has been found in your 'vars' file:
@ -5054,15 +5054,27 @@ One or more of these problems has been found in your 'vars' file:
* Use of 'EASYRSA_PASSIN' or 'EASYRSA_PASSOUT':
Storing password information in the 'vars' file is not permitted.
* Use of 'export':
Remove 'export' or replace it with 'set_var'.
* Use of unsupported characters:
These characters are not supported: \` backtick
Please, correct these errors and try again."
fi
if grep -q \
-e '[[:blank:]]export[[:blank:]]' \
-e '[[:blank:]]unset[[:blank:]]' \
"$vars"
then
warn "\
One or more of these problems has been found in your 'vars' file:
* Use of 'export':
Remove 'export' or replace it with 'set_var'.
* Use of 'unset':
Remove 'unset' ('force_set_var' may also work)."
fi
# Enable sourcing 'vars'
# shellcheck disable=SC2034 # appears unused
EASYRSA_CALLER=1