diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 9977ac6..47c52c4 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -4345,10 +4345,10 @@ Sourcing the vars file and building certificates will probably fail ..' # the variable when it is already defined (even if currently null) # Sets $1 as the value contained in $2 and exports (may be blank) set_var() { - var=$1 - shift - value="$*" - eval "export $var=\"\${$var-$value}\"" + [ "$1" ] || die "set_var - missing input" + [ "$1" = "${1% *}" ] || die "set_var - input error" + [ "$#" -lt 3 ] || die "set_var - excess input" + eval "export \"$1\"=\"\${$1-$2}\"" } #=> set_var()