From bc586578b4d6318e1a00317e5a14a19311649eac Mon Sep 17 00:00:00 2001 From: Josh Cepek Date: Wed, 24 Sep 2014 13:15:29 -0500 Subject: [PATCH] gen_req() no longer alters the global EXTRA_EXTS variable When forming the OpenSSL config replacement text, gen_req() should not alter the global variable as it is referred to again by sign_req() when the wrapper-commands build-*-full are called. This change localizes the replacement text to avoid competing over the global variable. Signed-off-by: Josh Cepek Based-On: patch submitted by Joe Hu Fixes: Issue #25 --- easyrsa3/easyrsa | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index c78647e..a7d6345 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -525,7 +525,7 @@ Continuing with key generation will replace this key." # When EASYRSA_EXTRA_EXTS is defined, append it to openssl's [req] section: if [ -n "$EASYRSA_EXTRA_EXTS" ]; then # Setup & insert the extra ext data keyed by a magic line - EASYRSA_EXTRA_EXTS=" + local extra_exts=" req_extensions = req_extra [ req_extra ] $EASYRSA_EXTRA_EXTS" @@ -534,7 +534,7 @@ $EASYRSA_EXTRA_EXTS" { while ( getline<"/dev/stdin" ) {print} next } {print} }' - print "$EASYRSA_EXTRA_EXTS" | \ + print "$extra_exts" | \ awk "$awkscript" "$EASYRSA_SSL_CONF" \ > "$EASYRSA_TEMP_FILE" \ || die "Copying SSL config to temp file failed"