[PATCH] Don't trap INT or TERM; they are redundant and can break `pass edit`.
Nick
nick at kousu.ca
Tue Feb 6 22:39:19 CET 2018
Hi, is there any news on this patch? Is it good or bad? Has no one had a chance to look at it yet?
Thanks.
22 janvier 2018 19:53 "Nick" <nick at kousu.ca> a écrit:
>
> [kousu at requiem password-store]$ cat 0001-Don-t-trap-INT-or-TERM-they-are-redundant-and-can-br.patch
>
> From cefb03e4fb75abdd878d96e1982e9723e8e7f280 Mon Sep 17 00:00:00 2001
> From: kousu <nick at kousu.ca>
> Date: Mon, 22 Jan 2018 16:52:06 -0500
> Subject: [PATCH] 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.
> ---
> src/password-store.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/password-store.sh b/src/password-store.sh
> index e3cd145..99d2d65 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
>
> }
> --
> 2.16.0
More information about the Password-Store
mailing list