Merge branch 'Tabiskabis-gen_crl-preserve-permissions'

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2023-09-20 21:22:32 +01:00
commit f426149d90
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -3734,12 +3734,18 @@ gen_crl() {
easyrsa_mktemp out_file_tmp || \
die "gen_crl - easyrsa_mktemp out_file_tmp"
if [ -r "$out_file" ]; then
cp -p "$out_file" "$out_file_tmp" || \
warn "Failed to preserve CRL file permissions."
fi
easyrsa_openssl ca -utf8 -gencrl -out "$out_file_tmp" \
${EASYRSA_CRL_DAYS:+ -days "$EASYRSA_CRL_DAYS"} \
${EASYRSA_PASSIN:+ -passin "$EASYRSA_PASSIN"} || \
die "CRL Generation failed."
mv ${EASYRSA_BATCH:+ -f} "$out_file_tmp" "$out_file"
mv ${EASYRSA_BATCH:+ -f} "$out_file_tmp" "$out_file" || \
die "Failed to update CRL file."
notice "\
An updated CRL has been created: