commit 5b95e618f38197b02ffccc3182c6b3b7fd482caf
parent 4e6a49ebff535fdf5a07890af661ba7a2be6588a
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date: Mon, 30 Jun 2014 15:04:02 +0200
edit: bsd mktemp needs nothing after the Xs
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/password-store.sh b/src/password-store.sh
@@ -421,7 +421,7 @@ cmd_edit() {
local passfile="$PREFIX/$path.gpg"
tmpdir #Defines $SECURE_TMPDIR
- local tmp_file="$(mktemp "$SECURE_TMPDIR/XXXXXXXXXXXXX.txt")"
+ local tmp_file="$(mktemp -u "$SECURE_TMPDIR/XXXXX")-${path//\//-}.txt"
local action="Add"
@@ -430,6 +430,7 @@ cmd_edit() {
action="Edit"
fi
${EDITOR:-vi} "$tmp_file"
+ [[ -f $tmp_file ]] || die "New password not saved."
while ! $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}" "$tmp_file"; do
yesno "GPG encryption failed. Would you like to try again?"
done