From 5b95e618f38197b02ffccc3182c6b3b7fd482caf Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 30 Jun 2014 15:04:02 +0200 Subject: edit: bsd mktemp needs nothing after the Xs --- src/password-store.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/password-store.sh b/src/password-store.sh index 38dce6c..295015b 100755 --- 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 -- cgit v1.2.3