From 1457458ab8b7a6db77e0f8f82870561f4f57a590 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Mon, 10 Oct 2022 14:53:26 -0400 Subject: [PATCH] Quote $@ in bash scripts --- gocrypt.bash | 12 ++++++------ pass-test | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gocrypt.bash b/gocrypt.bash index cdfa00c..eeff7bc 100755 --- a/gocrypt.bash +++ b/gocrypt.bash @@ -73,7 +73,7 @@ gocrypt_close() { gocrypt_delegate() { gocrypt_open_check # Delegate command to another `pass` instance that manages what is inside of the mountpoint - PASSWORD_STORE_DIR="$PWD/$gocrypt_dec_dir" pass $@ + PASSWORD_STORE_DIR="$PWD/$gocrypt_dec_dir" pass "$@" # Commit if there has been changes due to this operation pass git add "$gocrypt_dir" pass git commit -m "Encrypted pass operation inside gocrypt" "$gocrypt_dir" || echo "No git commit created" @@ -152,23 +152,23 @@ case "$1" in ;; init) shift - gocrypt_init $@ + gocrypt_init "$@" ;; open) shift - gocrypt_open $@ + gocrypt_open "$@" ;; crypt) shift - gocrypt_crypt $@ + gocrypt_crypt "$@" ;; close) shift - gocrypt_close $@ + gocrypt_close "$@" ;; ls|list|grep|find|search|show|insert|add|edit|generate|rm|remove|delete|mv|rename|cp|copy|git) # No shift here since we need to delegate these commands to another pass instance - gocrypt_delegate $@ + gocrypt_delegate "$@" ;; *) gocrypt_die "Unknown command $1 for gocrypt" diff --git a/pass-test b/pass-test index 22def5a..31d0a3c 100755 --- a/pass-test +++ b/pass-test @@ -1,3 +1,3 @@ #!/usr/bin/env sh -PASSWORD_STORE_DIR=$PWD/pass PASSWORD_STORE_EXTENSIONS_DIR=$PWD PASSWORD_STORE_ENABLE_EXTENSIONS=true pass $@ +PASSWORD_STORE_DIR=$PWD/pass PASSWORD_STORE_EXTENSIONS_DIR=$PWD PASSWORD_STORE_ENABLE_EXTENSIONS=true pass "$@"