summaryrefslogtreecommitdiff
path: root/security/pinentry-emacs/files/patch-pinentry-emacs
diff options
context:
space:
mode:
authorcashmere <cashmere@autistici.org>2026-07-25 12:43:49 +0200
committercashmere <cashmere@autistici.org>2026-07-25 12:43:49 +0200
commit110120f3c39c7849035d3c5fd4817459e5a85f21 (patch)
tree6c1ff81b704f2f31a57f6bd70066fff4ea1ec706 /security/pinentry-emacs/files/patch-pinentry-emacs
parent508825b0bae16d88b521bd87dcd96823d8736724 (diff)
downloadports-110120f3c39c7849035d3c5fd4817459e5a85f21.tar.gz
patch pinentry-emacs
Diffstat (limited to 'security/pinentry-emacs/files/patch-pinentry-emacs')
-rw-r--r--security/pinentry-emacs/files/patch-pinentry-emacs24
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)