From 53da18d96abf94ef1a6f9e9b44f484813183b3f4 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Fri, 10 Jun 2022 20:14:11 +0100 Subject: [PATCH] Prioritise 'trap' and 'detect_host()' over all other processing Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 8418d82..15a550c 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -4229,6 +4229,19 @@ NL=' # Be secure with a restrictive umask [ "$EASYRSA_NO_UMASK" ] || umask "${EASYRSA_UMASK:-077}" +# Register cleanup on EXIT +trap "cleanup" EXIT +# When SIGHUP, SIGINT, SIGQUIT, SIGABRT and SIGTERM, +# explicitly exit to signal EXIT (non-bash shells) +trap "exit 1" 1 +trap "exit 2" 2 +trap "exit 3" 3 +trap "exit 6" 6 +trap "exit 14" 15 + +# Get host details - does not require vars_setup +detect_host + # Initialisation requirements unset -v easyrsa_error_exit user_san_true user_vars_true @@ -4358,19 +4371,6 @@ subjectAltName = $val" shift done -# Register cleanup on EXIT -trap "cleanup" EXIT -# When SIGHUP, SIGINT, SIGQUIT, SIGABRT and SIGTERM, -# explicitly exit to signal EXIT (non-bash shells) -trap "exit 1" 1 -trap "exit 2" 2 -trap "exit 3" 3 -trap "exit 6" 6 -trap "exit 14" 15 - -# Get host details - does not require vars_setup -detect_host - # Set cmd now because vars_setup needs to know if this is init-pki cmd="$1" [ "$1" ] && shift # scrape off command