From 9278bc6923e26d52a5a8aa0e0274a4447dfa8511 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Wed, 17 Aug 2022 23:04:11 +0100 Subject: [PATCH] Expand the possible values of $prog_dir, include full path The 3 definitions of $prog_dir: - foo -> prog_dir=/search/path ## Not $PWD - ./foo -> prog_dir=. ## $PWD - /full/path/foo -> prog_dir=/full/path ## Could be $PWD '/full/path' was previously missing from the check. Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 43ccc0d..1636e26 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -3734,7 +3734,11 @@ vars_setup() { #prog_file2="$(which -- "$prog_file" 2>/dev/null)" && prog_file="$prog_file2" #prog_file2="$(readlink -f "$prog_file" 2>/dev/null)" && prog_file="$prog_file2" prog_dir="${prog_file%/*}" - if [ "$prog_dir" = . ]; then prog_in_pwd=1; else unset -v prog_in_pwd; fi + if [ "$prog_dir" = . ] || [ "$prog_dir" = "$PWD" ]; then + prog_in_pwd=1 + else + unset -v prog_in_pwd + fi # Program dir vars - This location is least wanted. prog_vars="${prog_dir}/vars"