From 3d140953846b0633049524ea6efbbf78239e9b99 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Mon, 8 May 2023 22:51:38 +0100 Subject: [PATCH] build-ca: Remove new key if moving new certificate fails Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 1 + 1 file changed, 1 insertion(+) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 3700cca..1c52239 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -1754,6 +1754,7 @@ build_ca: CA certificate password created via temp-files" die "Failed to move key temp-file" } mv "$out_file_tmp" "$out_file" || { + rm -f "$out_key" # Also remove the key die "Failed to move cert temp-file" }