From 21ac0a76bc090059543486660eaef6409667737b Mon Sep 17 00:00:00 2001 From: Eric F Crist Date: Wed, 9 Sep 2015 18:19:22 -0500 Subject: [PATCH] Use tmp file for gen-crl output The mv operation following the CRL creation isn't useful as there is no temp file to move. Instead, create the temp file during CRL creation, preventing a potential overwrite of a previous, valid, CRL. Thanks go to matteo.guglielmi@epfl.ch for this patch (via email). Signed-off-by: Eric F Crist --- easyrsa3/easyrsa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 01ad400..6fec288 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -734,7 +734,7 @@ gen_crl() { local out_file="$EASYRSA_PKI/crl.pem" out_file_tmp="$(mktemp -u "$out_file.XXXXXXXXXX")"; EASYRSA_TEMP_FILE_2="$out_file_tmp" - "$EASYRSA_OPENSSL" ca -utf8 -gencrl -out "$out_file" -config "$EASYRSA_SSL_CONF" || die "\ + "$EASYRSA_OPENSSL" ca -utf8 -gencrl -out "$out_file_tmp" -config "$EASYRSA_SSL_CONF" || die "\ CRL Generation failed. " mv "$out_file_tmp" "$out_file"; EASYRSA_TEMP_FILE_2=