gen-crl: preserve existing crl.pem ownership+mode

Signed-off-by: Tabis Kabis <Tabiskabis@users.noreply.github.com>
This commit is contained in:
Tabis Kabis 2023-09-09 12:17:08 +02:00 committed by GitHub
parent 6dac068b7e
commit 342b588a3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3721,6 +3721,11 @@ 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 copy existing crl.pem - won't preserve file permissions."
fi
easyrsa_openssl ca -utf8 -gencrl -out "$out_file_tmp" \
${EASYRSA_CRL_DAYS:+ -days "$EASYRSA_CRL_DAYS"} \
${EASYRSA_PASSIN:+ -passin "$EASYRSA_PASSIN"} || \