From 9518add6eb4729bcd556fdda044c7f849775d72d Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Sat, 17 Jul 2021 22:46:26 +0300 Subject: [PATCH] pass: update src-password-store.sh.patch --- packages/pass/src-password-store.sh.patch | 67 +++++++++++------------ 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/packages/pass/src-password-store.sh.patch b/packages/pass/src-password-store.sh.patch index b07466571..14a5794e0 100644 --- a/packages/pass/src-password-store.sh.patch +++ b/packages/pass/src-password-store.sh.patch @@ -1,37 +1,32 @@ -diff --git a/src/password-store.sh b/src/password-store.sh -index 7264ffc..f924de3 100755 ---- a/src/password-store.sh -+++ b/src/password-store.sh -@@ -11,7 +11,7 @@ GPG="gpg" - export GPG_TTY="${GPG_TTY:-$(tty 2>/dev/null)}" - which gpg2 &>/dev/null && GPG="gpg2" - [[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" ) -- -+TMPDIR=$PREFIX/tmp - PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - EXTENSIONS="${PASSWORD_STORE_EXTENSIONS_DIR:-$PREFIX/.extensions}" - X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}" -@@ -156,11 +156,11 @@ clip() { - # trailing new lines. - local sleep_argv0="password store sleep on display $DISPLAY" - pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 -- local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | $BASE64)" -- echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard" -+ local before="$(termux-clipboard-get 2>/dev/null | $BASE64)" -+ echo -n "$1" | termux-clipboard-set || die "Error: Could not copy data to the clipboard" - ( - ( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" ) -- local now="$(xclip -o -selection "$X_SELECTION" | $BASE64)" -+ local now="$(termux-clipboard-get | $BASE64)" - [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now" +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" - # It might be nice to programatically check to see if klipper exists, -@@ -172,7 +172,7 @@ clip() { - # so we axe it here: - qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null - -- echo "$before" | $BASE64 -d | xclip -selection "$X_SELECTION" -+ echo "$before" | $BASE64 -d | termux-clipboard-set - ) >/dev/null 2>&1 & disown - echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." - } +@@ -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"