Skip to content

Commit 622972f

Browse files
authored
Merge pull request #247 from tegonal/bugfix/promptForSecret-paste
fix promptForSecret when pasting secrets
2 parents 7e160bc + e0ddf59 commit 622972f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utility/secret-utils.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ function promptForSecret() {
123123

124124
exitIfVariablesNotDeclared "$2"
125125

126+
# without using it, pasting secrets sometimes reveals parts of the secret (read is too slow)
127+
stty -echo
128+
trap "stty echo; return 130" INT
129+
trap "stty echo" EXIT
130+
126131
# shellcheck disable=SC2059 # we want to be able to use newline in the $prompt, hence OK
127132
printf "$1"
128133

@@ -143,6 +148,7 @@ function promptForSecret() {
143148
printf "*"
144149
fi
145150
done
151+
stty echo
146152

147153
printf "\n"
148154

0 commit comments

Comments
 (0)