From 02f13f606449df4ab7cef93ea13678cbe31467ef Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Tue, 18 Oct 2022 19:44:56 +0100 Subject: [PATCH] Find data-files in the correct order (#727) Squashed commit of the following: commit 136484f3ed28d57bf4244d9c716b8daa1cd9a8a7 Merge: 2083fb2 cae6357 Author: Richard T Bonhomme Date: Tue Oct 18 19:44:17 2022 +0100 Merge branch 'fix-order-725' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-fix-order-725 Signed-off-by: Richard T Bonhomme commit cae6357c63b473e33e31620264bef4ede596ffac Author: Richard T Bonhomme Date: Sun Oct 16 22:52:44 2022 +0100 Find data-files in the correct order With this change the PKI becomes the 'preferred' location for data-files. All other supported locations are searched by specific order. While this new order is the correct 'preferred' order, the associated code install_data_to_pki() needs to be simplified. Closes: #725 Closes: #723 Signed-off-by: Richard T Bonhomme Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 4f76077..a0e5652 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -1093,12 +1093,14 @@ find_x509_types_dir() { # Find x509-types dir, in specific order for area in \ + "$EASYRSA_PKI" \ + "$EASYRSA" \ "$PWD" \ + "${0%/*}" \ '/usr/local/share/easy-rsa' \ '/usr/share/easy-rsa' \ - "${0%/*}" \ '/etc/easy-rsa' \ - # EOL - # Add more distros here + # EOL do # Find x509-types [ -e "${area}/$x509_types_dir" ] || continue @@ -1164,12 +1166,14 @@ install_data_to_pki () { # Find and copy data-files, in specific order for area in \ - '/usr/local/share/easy-rsa' \ - '/usr/share/easy-rsa' \ + "$EASYRSA_PKI" \ + "$EASYRSA" \ "$PWD" \ "${0%/*}" \ + '/usr/local/share/easy-rsa' \ + '/usr/share/easy-rsa' \ '/etc/easy-rsa' \ - # EOL - # Add more distros here + # EOL do # Omitting "$vars_file" for source in \