Skip to content

Commit

Permalink
Remove EASYRSA_NO_VARS; Allow graceful use without a vars file
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Dec 5, 2023
1 parent e3a47af commit 3c0ca17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Easy-RSA 3 ChangeLog

3.2.0 (TBD)
* Remove EASYRSA_NO_VARS; Allow graceful use without a vars file (#1043)
* New diagnostic command 'display-cn' (#1040)
* Expand renewable certificate types to include code-signing (#1039)

Expand Down
19 changes: 6 additions & 13 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -5602,15 +5602,8 @@ To correct this problem, it is recommended that you either:
# If not present, defaults are used to support
# running without a sourced config format.
select_vars() {
# No vars file will be used
if [ "$EASYRSA_NO_VARS" ]; then
verbose "select_vars: EASYRSA_NO_VARS"
unset -v EASYRSA_VARS_FILE
# skip the rest of this function
return

# User specified vars file will be used ONLY
elif [ "$EASYRSA_VARS_FILE" ]; then
if [ "$EASYRSA_VARS_FILE" ]; then
# Takes priority, nothing to do
verbose "select_vars: EASYRSA_VARS_FILE"

Expand Down Expand Up @@ -5668,7 +5661,8 @@ select_vars() {
if [ -z "$EASYRSA_VARS_FILE" ]; then
[ "$require_pki" ] && information "\
No Easy-RSA 'vars' configuration file exists!"
EASYRSA_NO_VARS=1
# select_vars failed to find a vars file
return 1
fi
} # => select_vars()

Expand Down Expand Up @@ -7211,10 +7205,9 @@ esac

# Intelligent env-var detection and auto-loading:
# Select vars file as EASYRSA_VARS_FILE
select_vars

# source the vars file
[ "$EASYRSA_NO_VARS" ] || source_vars "$EASYRSA_VARS_FILE"
# then source the vars file, if found
# otherwise, ignore no vars file
select_vars && source_vars "$EASYRSA_VARS_FILE"

# then set defaults
default_vars
Expand Down

0 comments on commit 3c0ca17

Please sign in to comment.