From b4dc2ad0ea7aadb0e990dd2561919a4b77c98da9 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Sat, 17 Dec 2022 21:45:23 +0000 Subject: [PATCH] Command renew: Process options correctly and minor improvements Process options correctly: * This removes an errant 'shift' when processing options. Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 742f36b..993e9bd 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -2171,16 +2171,17 @@ Run easyrsa without commands for usage and command help." # Upgrade CA index.txt.attr - unique_subject = no up23_upgrade_ca || die "Failed to upgrade CA to support renewal." - # Set 'nopass' - case "$1" in - nopass) - warn "\ -Option 'nopass' is no longer supported by command 'renew'." - shift - ;; - '') :; shift ;; # Empty ok - *) die "Unknown option: $1" - esac + # deprecate ALL options + while [ "$1" ]; do + case "$1" in + nopass) + warn "\ +Option 'nopass' is not supported by command 'renew'." + ;; + *) die "Unknown option: $1" + esac + shift + done # referenced cert must exist: [ -f "$crt_in" ] || die "\