aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno2016-02-22 10:45:53 +0900
committerDaiki Ueno2016-02-22 10:45:53 +0900
commit5e34c3671a657ee4b0355d062e1412f1f009dbd0 (patch)
tree9c26d1982bd63f494d612128ce226b8539b449cd
parente19c1c301700430ae428f40c2a364671f5d50dcf (diff)
downloademacs-5e34c3671a657ee4b0355d062e1412f1f009dbd0.tar.gz
emacs-5e34c3671a657ee4b0355d062e1412f1f009dbd0.zip
Revert "Change the default socket location for pinentry"
This reverts commit e34fbdee8aca84b98393b06b2450837d175999ca. It turned out that the address is fixed in Pinentry itself.
-rw-r--r--lisp/net/pinentry.el41
1 files changed, 21 insertions, 20 deletions
diff --git a/lisp/net/pinentry.el b/lisp/net/pinentry.el
index f83b0734fa2..285f86481bc 100644
--- a/lisp/net/pinentry.el
+++ b/lisp/net/pinentry.el
@@ -26,9 +26,6 @@
26;; This package allows GnuPG passphrase to be prompted through the 26;; This package allows GnuPG passphrase to be prompted through the
27;; minibuffer instead of graphical dialog. 27;; minibuffer instead of graphical dialog.
28;; 28;;
29;; This feature requires GnuPG 2.1.5 or later and Pinentry 0.9.5 or
30;; later, with the Emacs support compiled in.
31;;
32;; To use, add "allow-emacs-pinentry" to "~/.gnupg/gpg-agent.conf", 29;; To use, add "allow-emacs-pinentry" to "~/.gnupg/gpg-agent.conf",
33;; reload the configuration with "gpgconf --reload gpg-agent", and 30;; reload the configuration with "gpgconf --reload gpg-agent", and
34;; start the server with M-x pinentry-start. 31;; start the server with M-x pinentry-start.
@@ -41,15 +38,17 @@
41;; where pinentry and Emacs communicate through a Unix domain socket 38;; where pinentry and Emacs communicate through a Unix domain socket
42;; created at: 39;; created at:
43;; 40;;
44;; ~/.emacs.d/pinentry/pinentry 41;; ${TMPDIR-/tmp}/emacs$(id -u)/pinentry
42;;
43;; under the same directory which server.el uses. The protocol is a
44;; subset of the Pinentry Assuan protocol described in (info
45;; "(pinentry) Protocol").
45;; 46;;
46;; The protocol is a subset of the Pinentry Assuan protocol described 47;; NOTE: As of August 2015, this feature requires newer versions of
47;; in (info "(pinentry) Protocol"). 48;; GnuPG (2.1.5+) and Pinentry (0.9.5+).
48 49
49;;; Code: 50;;; Code:
50 51
51(eval-when-compile (require 'cl-lib))
52
53(defgroup pinentry nil 52(defgroup pinentry nil
54 "The Pinentry server" 53 "The Pinentry server"
55 :version "25.1" 54 :version "25.1"
@@ -77,7 +76,10 @@
77 76
78(defvar pinentry--prompt-buffer nil) 77(defvar pinentry--prompt-buffer nil)
79 78
80(defvar pinentry--socket-dir (locate-user-emacs-file "pinentry") 79;; We use the same location as `server-socket-dir', when local sockets
80;; are supported.
81(defvar pinentry--socket-dir
82 (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid))
81 "The directory in which to place the server socket. 83 "The directory in which to place the server socket.
82If local sockets are not supported, this is nil.") 84If local sockets are not supported, this is nil.")
83 85
@@ -170,17 +172,16 @@ will not be shown."
170 (ignore-errors 172 (ignore-errors
171 (let (delete-by-moving-to-trash) 173 (let (delete-by-moving-to-trash)
172 (delete-file server-file))) 174 (delete-file server-file)))
173 (cl-letf (((default-file-modes) ?\700)) 175 (setq pinentry--server-process
174 (setq pinentry--server-process 176 (make-network-process
175 (make-network-process 177 :name "pinentry"
176 :name "pinentry" 178 :server t
177 :server t 179 :noquery t
178 :noquery t 180 :sentinel #'pinentry--process-sentinel
179 :sentinel #'pinentry--process-sentinel 181 :filter #'pinentry--process-filter
180 :filter #'pinentry--process-filter 182 :coding 'no-conversion
181 :coding 'no-conversion 183 :family 'local
182 :family 'local 184 :service server-file))
183 :service server-file)))
184 (process-put pinentry--server-process :server-file server-file)))) 185 (process-put pinentry--server-process :server-file server-file))))
185 186
186(defun pinentry-stop () 187(defun pinentry-stop ()