pash: be more explicit about glob disable

This commit is contained in:
Dylan Araps 2019-11-30 15:05:50 +00:00
parent f917d4643c
commit 988755057d
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 9 additions and 5 deletions

14
pash
View File

@ -1,4 +1,4 @@
#!/bin/sh -f #!/bin/sh
# #
# pash - simple password manager. # pash - simple password manager.
@ -204,10 +204,6 @@ main() {
# state on exit or Ctrl+C. # state on exit or Ctrl+C.
trap 'stty echo icanon' INT EXIT trap 'stty echo icanon' INT EXIT
# Ensure that debug mode is never enabled to
# prevent the password from leaking.
set +x
case $1 in case $1 in
a*) pw_add "$2" ;; a*) pw_add "$2" ;;
c*) pw_copy "$2" ;; c*) pw_copy "$2" ;;
@ -219,4 +215,12 @@ main() {
esac esac
} }
# Ensure that debug mode is never enabled to
# prevent the password from leaking.
set +x
# Ensure that globbing is globally disabled
# to avoid insecurities with word-splitting.
set -f
main "$@" main "$@"