diff options
Diffstat (limited to 'security/pinentry-emacs/files/patch-pinentry-emacs')
| -rw-r--r-- | security/pinentry-emacs/files/patch-pinentry-emacs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/security/pinentry-emacs/files/patch-pinentry-emacs b/security/pinentry-emacs/files/patch-pinentry-emacs index 923dec5..b17ba53 100644 --- a/security/pinentry-emacs/files/patch-pinentry-emacs +++ b/security/pinentry-emacs/files/patch-pinentry-emacs @@ -1,7 +1,25 @@ ---- pinentry-emacs.orig 2026-07-11 14:01:00 UTC +--- pinentry-emacs.orig 2017-11-27 09:56:54 UTC +++ pinentry-emacs -@@ -31,7 +31,8 @@ - RES=$(emacsclient -e "(pinentry-emacs \"$DESC\" \"$PROMPT\" \"$OK\" \"$ERROR\")" | sed -e 's/^"//' -e 's/"$//') +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/usr/local/bin/bash + set -o pipefail + echo OK + while read cmd rest +@@ -28,10 +28,19 @@ do + ;; + GETPIN) + +- RES=$(emacsclient -e "(pinentry-emacs \"$DESC\" \"$PROMPT\" \"$OK\" \"$ERROR\")" | sed -e 's/^"//' -e 's/"$//') ++ # Resolve the Emacs server socket the way emacsclient does ++ # ($EMACS_SOCKET_NAME, then $XDG_RUNTIME_DIR/emacs/server), but ++ # fall back to $HOME/.run/emacs/server when gpg-agent was started ++ # with a different XDG_RUNTIME_DIR than the Emacs daemon. ++ SOCKET="${EMACS_SOCKET_NAME:-${XDG_RUNTIME_DIR:+$XDG_RUNTIME_DIR/emacs/server}}" ++ if [ -n "$SOCKET" ] && [ ! -S "$SOCKET" ] && [ -S "$HOME/.run/emacs/server" ]; then ++ SOCKET="$HOME/.run/emacs/server" ++ fi ++ RES=$(emacsclient ${SOCKET:+--socket-name="$SOCKET"} -e "(pinentry-emacs \"$DESC\" \"$PROMPT\" \"$OK\" \"$ERROR\")" | sed -e 's/^"//' -e 's/"$//') if [ $? -ne 0 ] then - RES=$(lukspinentry) |
