From 30bb214c868e19a33ffc6bd8ed96759bdc781070 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Sat, 25 Jun 2022 16:16:15 +0100 Subject: [PATCH] Ensure 'pki/renewed/' exist for 'rewind-renew' It is possible that only the 'foo_by_serial' folders will exist in the 'pki/renewed' sub-folder when 'rewind-renew' is needed. Create the required folders when using 'rewind-renew'. Closes: #612 Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 81962b3..391eb42 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -2406,6 +2406,11 @@ Unexpected input in file: $req_in" key_out="$out_dir/private/$crt_cn.key" req_out="$out_dir/reqs/$crt_cn.req" + # Create out_dir + for newdir in issued private reqs; do + mkdir -p "$out_dir/$newdir" || die "Failed to create: $out_dir/$newdir" + done + # NEVER over-write a renewed cert, revoke it first deny_msg="\ Cannot renew this certificate because a conflicting file exists.