summaryrefslogtreecommitdiff
path: root/src/password-store.sh
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-02-05 01:20:18 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-02-05 01:20:18 +0100
commit1c50cbefb2e636a9b6c76e90c2a287acfa8d3f30 (patch)
treeaec58b54fc06f7a3192cd7ea7f938b1fa5640883 /src/password-store.sh
parent90373f042e8ce679870c1868cb0957fb825d00d5 (diff)
downloadpass-1c50cbefb2e636a9b6c76e90c2a287acfa8d3f30.tar.gz
pass-1c50cbefb2e636a9b6c76e90c2a287acfa8d3f30.tar.bz2
pass-1c50cbefb2e636a9b6c76e90c2a287acfa8d3f30.zip
Insert and edit work on files, so don't let the arguments be directories
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 8051451..8b640bd 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -366,7 +366,7 @@ cmd_insert() {
esac done
[[ $err -ne 0 || ( $multiline -eq 1 && $noecho -eq 0 ) || $# -ne 1 ]] && die "Usage: $PROGRAM $COMMAND [--echo,-e | --multiline,-m] [--force,-f] pass-name"
- local path="$1"
+ local path="${1%/}"
local passfile="$PREFIX/$path.gpg"
check_sneaky_paths "$path"
@@ -404,7 +404,7 @@ cmd_insert() {
cmd_edit() {
[[ $# -ne 1 ]] && die "Usage: $PROGRAM $COMMAND pass-name"
- local path="$1"
+ local path="${1%/}"
check_sneaky_paths "$path"
mkdir -p -v "$PREFIX/$(dirname "$path")"
set_gpg_recipients "$(dirname "$path")"