password-store

Simple password manager using gpg and ordinary unix directories
git clone https://git.zx2c4.com/password-store
Log | Files | Refs | README | LICENSE

commit 78a56a4d7b7d74ded10436f9d1e972cc47807cab
parent 326a12c9bf8f8b8a703c8a518c035f547524e01e
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Mon, 30 Jun 2014 14:44:04 +0200

tmpdir: more cross platform solution, and .txt file ending

Diffstat:
Msrc/password-store.sh | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh @@ -168,7 +168,7 @@ tmpdir() { [[ $1 == "nowarn" ]] && warn=0 local template="$PROGRAM.XXXXXXXXXXXXX" if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then - SECURE_TMPDIR="$(TMPDIR=/dev/shm mktemp -d -t "$template")" + SECURE_TMPDIR="$(mktemp -d "/dev/shm/$template")" remove_tmpfile() { rm -rf "$SECURE_TMPDIR" } @@ -182,7 +182,7 @@ tmpdir() { Are you sure you would like to continue? _EOF )" - SECURE_TMPDIR="$(mktemp -d -t "$template")" + SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/$template")" shred_tmpfile() { find "$SECURE_TMPDIR" -type f -exec $SHRED {} + rm -rf "$SECURE_TMPDIR" @@ -419,10 +419,9 @@ cmd_edit() { mkdir -p -v "$PREFIX/$(dirname "$path")" set_gpg_recipients "$(dirname "$path")" local passfile="$PREFIX/$path.gpg" - local template="$PROGRAM.XXXXXXXXXXXXX" tmpdir #Defines $SECURE_TMPDIR - local tmp_file="$(TMPDIR="$SECURE_TMPDIR" mktemp -t "$template")" + local tmp_file="$(mktemp "$SECURE_TMPDIR/XXXXXXXXXXXXX.txt")" local action="Add"