pass: update src-password-store.sh.patch

This commit is contained in:
Leonid Pliushch 2021-07-17 22:46:26 +03:00
parent b2757b780c
commit 9518add6eb
No known key found for this signature in database
GPG Key ID: 45F2964132545795
1 changed files with 31 additions and 36 deletions

View File

@ -1,37 +1,32 @@
diff --git a/src/password-store.sh b/src/password-store.sh diff -uNr password-store-1.7.4/src/password-store.sh password-store-1.7.4.mod/src/password-store.sh
index 7264ffc..f924de3 100755 --- password-store-1.7.4/src/password-store.sh 2021-06-11 19:49:06.000000000 +0300
--- a/src/password-store.sh +++ password-store-1.7.4.mod/src/password-store.sh 2021-07-17 22:45:01.663534629 +0300
+++ b/src/password-store.sh @@ -168,7 +168,9 @@
@@ -11,7 +11,7 @@ GPG="gpg" local paste_cmd=( xclip -o -selection "$X_SELECTION" )
export GPG_TTY="${GPG_TTY:-$(tty 2>/dev/null)}" local display_name="$DISPLAY"
which gpg2 &>/dev/null && GPG="gpg2" else
[[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" ) - die "Error: No X11 or Wayland display detected"
- + local copy_cmd=( termux-clipboard-set )
+TMPDIR=$PREFIX/tmp + local paste_cmd=( termux-clipboard-get )
PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + local display_name="termux"
EXTENSIONS="${PASSWORD_STORE_EXTENSIONS_DIR:-$PREFIX/.extensions}" fi
X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}" local sleep_argv0="password store sleep on display $display_name"
@@ -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"
# It might be nice to programatically check to see if klipper exists, @@ -225,7 +227,7 @@
@@ -172,7 +172,7 @@ clip() { }
# so we axe it here: trap remove_tmpfile EXIT
qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null else
- [[ $warn -eq 1 ]] && yesno "$(cat <<-_EOF
- echo "$before" | $BASE64 -d | xclip -selection "$X_SELECTION" + [[ $(uname -o) == "Android" ]] || [[ $warn -eq 1 ]] && yesno "$(cat <<-_EOF
+ echo "$before" | $BASE64 -d | termux-clipboard-set Your system does not have /dev/shm, which means that it may
) >/dev/null 2>&1 & disown be difficult to entirely erase the temporary non-encrypted
echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." 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"