pash: prevent password from leaking through set -x

This commit is contained in:
Dylan Araps 2019-11-29 23:28:36 +00:00
parent e24b660909
commit a6f3d72030
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 4 additions and 0 deletions

4
pash
View File

@ -178,6 +178,10 @@ main() {
# state on exit or Ctrl+C.
trap 'stty echo icanon' INT EXIT
# Ensure that debug mode is never enabled to
# prevent the password from leaking.
set +x
case $1 in
a*) pw_add "$2" ;;
c*) pw_copy "$2" ;;