termux-packages/packages/pass/src-password-store.sh.patch
2021-07-17 23:25:11 +03:00

33 lines
1.3 KiB
Diff

diff -uNr password-store-1.7.4/src/password-store.sh password-store-1.7.4.mod/src/password-store.sh
--- password-store-1.7.4/src/password-store.sh 2021-06-11 19:49:06.000000000 +0300
+++ password-store-1.7.4.mod/src/password-store.sh 2021-07-17 22:45:01.663534629 +0300
@@ -168,7 +168,9 @@
local paste_cmd=( xclip -o -selection "$X_SELECTION" )
local display_name="$DISPLAY"
else
- die "Error: No X11 or Wayland display detected"
+ local copy_cmd=( termux-clipboard-set )
+ local paste_cmd=( termux-clipboard-get )
+ local display_name="termux"
fi
local sleep_argv0="password store sleep on display $display_name"
@@ -225,7 +227,7 @@
}
trap remove_tmpfile EXIT
else
- [[ $warn -eq 1 ]] && yesno "$(cat <<-_EOF
+ [[ $(uname -o) == "Android" ]] || [[ $warn -eq 1 ]] && yesno "$(cat <<-_EOF
Your system does not have /dev/shm, which means that it may
be difficult to entirely erase the temporary non-encrypted
password file after editing.
@@ -233,7 +235,7 @@
Are you sure you would like to continue?
_EOF
)"
- SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/$template")"
+ SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-@TERMUX_PREFIX@/tmp}/$template")"
shred_tmpfile() {
find "$SECURE_TMPDIR" -type f -exec $SHRED {} +
rm -rf "$SECURE_TMPDIR"