summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Kousu <nick@kousu.ca>2018-06-14 15:28:36 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-14 16:58:28 +0200
commit4a6fa5cbdf093d7873524fe566f58bca3761592e (patch)
tree4f0cb359b09ab8f7ce70662b5db239185bff2ead /src
parentfd2cbdacaed23c57b03cde19fe5eb6f910420855 (diff)
downloadpass-4a6fa5cbdf093d7873524fe566f58bca3761592e.tar.gz
pass-4a6fa5cbdf093d7873524fe566f58bca3761592e.tar.bz2
pass-4a6fa5cbdf093d7873524fe566f58bca3761592e.zip
Don't trap INT or TERM; they are redundant and can break `pass edit`.
Some EDITORs, notably Linux vi(1), which is the fallback default in pass, apparently send INT when they exit, and when pass is run under bash (which is also its default)--if you have /dev/shm/ available--bash catches this and cleans up your edited password file *before* it can be reencrypted and saved. This only happens with `pass edit`; none of the other commands combine tmpdir and $EDITOR.
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 0c9b35d..3f25185 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -203,7 +203,7 @@ tmpdir() {
remove_tmpfile() {
rm -rf "$SECURE_TMPDIR"
}
- trap remove_tmpfile INT TERM EXIT
+ trap remove_tmpfile EXIT
else
[[ $warn -eq 1 ]] && yesno "$(cat <<-_EOF
Your system does not have /dev/shm, which means that it may
@@ -218,7 +218,7 @@ tmpdir() {
find "$SECURE_TMPDIR" -type f -exec $SHRED {} +
rm -rf "$SECURE_TMPDIR"
}
- trap shred_tmpfile INT TERM EXIT
+ trap shred_tmpfile EXIT
fi
}