Skip to content

Commit

Permalink
init-pki: Never create a vars.example and vars file in the pki
Browse files Browse the repository at this point in the history
For 'init-pki, disable creating vars.example, which also disables
creating a vars file in the PKI.

Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Sep 14, 2023
1 parent 6608952 commit eedb81e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -1454,8 +1454,8 @@ install_data_to_pki() {
EASYRSA_EXT_DIR "${area}/${x509_types_dir}"

# Find other files - Omitting "$vars_file"
# shellcheck disable=2066 # Loop will only run once
for source in \
"$vars_file_example" \
"$ssl_cnf_file" \
# EOL
do
Expand All @@ -1480,16 +1480,6 @@ install_data_to_pki: $context - COMPLETED"
return
fi

# Always require a pki/vars.example file
if [ -e "$EASYRSA_PKI/vars.example" ];then
: # ok
else
create_vars_example > "$EASYRSA_PKI/vars.example" || \
die "install_data_to_pki - create_vars_example FAILED"
verbose "\
install_data_to_pki: $context - create_vars_example OK"
fi

# Create PKI/vars from PKI/example
unset -v new_vars_true
if [ "$found_vars" = 1 ] || [ "$user_vars_true" ] || \
Expand Down Expand Up @@ -5640,7 +5630,6 @@ The 'vars' file was not found:

# set up PKI path vars - Top preference
pki_vars="${EASYRSA_PKI:-$PWD/pki}/vars"
expected_pki_vars="$pki_vars"

# Some other place vars, out of scope.
if [ "$EASYRSA" ]; then
Expand Down

0 comments on commit eedb81e

Please sign in to comment.