From abbae145927cb9f60ce0e51a8e30450ddec9ce26 Mon Sep 17 00:00:00 2001 From: Richard Bonhomme <25598447+TinCanTech@users.noreply.github.com> Date: Sat, 29 Sep 2018 13:57:05 +0100 Subject: [PATCH 1/2] Improve hide_read_pass function --- easyrsa3/easyrsa | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 68aaf3c..8c6c61c 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -446,17 +446,9 @@ Your newly created PKI dir is: $EASYRSA_PKI hide_read_pass() { - test_file="$EASYRSA/bin/sh.exe" - if [ -f "$test_file" ] - then - set +o echo - read -r "$@" - set -o echo - else - stty -echo - read -r "$@" - stty echo - fi + (set +o echo 2>/dev/null) && set +o echo || stty -echo + read -r "$@" + (set -o echo 2>/dev/null) && set -o echo || stty echo } # => hide_read_pass() # build-ca backend: From e1e3ce8860336bbab20224e57b5c18cbb6956676 Mon Sep 17 00:00:00 2001 From: Richard Bonhomme <25598447+TinCanTech@users.noreply.github.com> Date: Tue, 2 Oct 2018 18:52:05 +0100 Subject: [PATCH 2/2] Improve hide_read_pass function Follow example from prog_exit function --- easyrsa3/easyrsa | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 8c6c61c..e68e337 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -446,9 +446,9 @@ Your newly created PKI dir is: $EASYRSA_PKI hide_read_pass() { - (set +o echo 2>/dev/null) && set +o echo || stty -echo + (set +o echo 2>/dev/null) || stty -echo read -r "$@" - (set -o echo 2>/dev/null) && set -o echo || stty echo + (set -o echo 2>/dev/null) || stty echo } # => hide_read_pass() # build-ca backend: