summaryrefslogtreecommitdiff
path: root/src/password-store.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 6c89c2f..ad22833 100755
--- 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