Skip to content

Commit

Permalink
source_vars(): 'init-pki', prioritise USER set EASYRSA_PKI and EASYRSA
Browse files Browse the repository at this point in the history
When souring 'vars' file, allow user set EASYRSA_PKI and EASYRSA
to take priority over default settings.

This will still error out when default 'pki/vars' sets EASYRSA_PKI to
a non-default PKI.

Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Sep 12, 2023
1 parent d2c25de commit dc15f35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -5785,7 +5785,13 @@ Remove 'unset' ('force_set_var' may also work)."
# Required for init-pki
case "$cmd" in
init-pki|clean-all)
expected_pki="${expected_pki:-"$PWD/pki"}"
if [ "$EASYRSA_PKI" ]; then
expected_pki="${expected_pki:-"$EASYRSA_PKI"}"
elif [ "$EASYRSA" ]; then
expected_pki="${expected_pki:-"$EASYRSA/pki"}"
else
expected_pki="${expected_pki:-"$PWD/pki"}"
fi
;;
*) : # ok
esac
Expand Down

0 comments on commit dc15f35

Please sign in to comment.