commit 4a6fa5cbdf093d7873524fe566f58bca3761592e
parent fd2cbdacaed23c57b03cde19fe5eb6f910420855
Author: Nick Kousu <nick@kousu.ca>
Date: Thu, 14 Jun 2018 15:28:36 +0200
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:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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
}