From ef59ea7dd93151b498f8ae2ac60c28fe274b37d4 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Tue, 29 Mar 2022 23:38:37 +0100 Subject: [PATCH] copy_data_to_pki(): Immediate exit-with-error or 'shift' on success This captures any copy errors and/or clears the excess second parameter. Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 7d9d9dc..7615e59 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -700,7 +700,8 @@ install_data_to_pki () { # Copy the source to the PKI copy_data_to_pki () { - cp ${2:+-R} "$1" "$EASYRSA_PKI" + cp ${2:+-R} "$1" "$EASYRSA_PKI" || return + shift # Clear recurse } # => copy_data_to_pki () # Disable terminal echo, if possible, otherwise warn