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 8253fe2a2caed31c245be285d196ebd56590c5c3
parent f9cfc1e96e2a2f0562aac7c07a5f11ebf66ca9ae
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Tue, 29 Apr 2014 05:46:52 +0200

edit: pass local variable to trap function

Diffstat:
Msrc/password-store.sh | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh @@ -407,10 +407,14 @@ cmd_edit() { local passfile="$PREFIX/$path.gpg" local template="$PROGRAM.XXXXXXXXXXXXX" - trap '$SHRED "$tmp_file"; rm -rf "$SECURE_TMPDIR" "$tmp_file"' INT TERM EXIT - tmpdir #Defines $SECURE_TMPDIR local tmp_file="$(TMPDIR="$SECURE_TMPDIR" mktemp -t "$template")" + eval "shred_tmpfile() { + $SHRED '$tmp_file' + rm -rf '$SECURE_TMPDIR' '$tmp_file' + }" + trap shred_tmpfile INT TERM EXIT + local action="Add" if [[ -f $passfile ]]; then