summaryrefslogtreecommitdiff
path: root/lisp/net/pinentry.el
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2016-02-22 10:45:53 +0900
committerDaiki Ueno <ueno@gnu.org>2016-02-22 10:45:53 +0900
commit5e34c3671a657ee4b0355d062e1412f1f009dbd0 (patch)
tree9c26d1982bd63f494d612128ce226b8539b449cd /lisp/net/pinentry.el
parente19c1c301700430ae428f40c2a364671f5d50dcf (diff)
downloademacs-5e34c3671a657ee4b0355d062e1412f1f009dbd0.tar.gz
Revert "Change the default socket location for pinentry"
This reverts commit e34fbdee8aca84b98393b06b2450837d175999ca. It turned out that the address is fixed in Pinentry itself.
Diffstat (limited to 'lisp/net/pinentry.el')
-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 @@
;; This package allows GnuPG passphrase to be prompted through the
;; minibuffer instead of graphical dialog.
;;
-;; This feature requires GnuPG 2.1.5 or later and Pinentry 0.9.5 or
-;; later, with the Emacs support compiled in.
-;;
;; To use, add "allow-emacs-pinentry" to "~/.gnupg/gpg-agent.conf",
;; reload the configuration with "gpgconf --reload gpg-agent", and
;; start the server with M-x pinentry-start.
@@ -41,15 +38,17 @@
;; where pinentry and Emacs communicate through a Unix domain socket
;; created at:
;;
-;; ~/.emacs.d/pinentry/pinentry
+;; ${TMPDIR-/tmp}/emacs$(id -u)/pinentry
+;;
+;; under the same directory which server.el uses. The protocol is a
+;; subset of the Pinentry Assuan protocol described in (info
+;; "(pinentry) Protocol").
;;
-;; The protocol is a subset of the Pinentry Assuan protocol described
-;; in (info "(pinentry) Protocol").
+;; NOTE: As of August 2015, this feature requires newer versions of
+;; GnuPG (2.1.5+) and Pinentry (0.9.5+).
;;; Code:
-(eval-when-compile (require 'cl-lib))
-
(defgroup pinentry nil
"The Pinentry server"
:version "25.1"
@@ -77,7 +76,10 @@
(defvar pinentry--prompt-buffer nil)
-(defvar pinentry--socket-dir (locate-user-emacs-file "pinentry")
+;; We use the same location as `server-socket-dir', when local sockets
+;; are supported.
+(defvar pinentry--socket-dir
+ (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid))
"The directory in which to place the server socket.
If local sockets are not supported, this is nil.")
@@ -170,17 +172,16 @@ will not be shown."
(ignore-errors
(let (delete-by-moving-to-trash)
(delete-file server-file)))
- (cl-letf (((default-file-modes) ?\700))
- (setq pinentry--server-process
- (make-network-process
- :name "pinentry"
- :server t
- :noquery t
- :sentinel #'pinentry--process-sentinel
- :filter #'pinentry--process-filter
- :coding 'no-conversion
- :family 'local
- :service server-file)))
+ (setq pinentry--server-process
+ (make-network-process
+ :name "pinentry"
+ :server t
+ :noquery t
+ :sentinel #'pinentry--process-sentinel
+ :filter #'pinentry--process-filter
+ :coding 'no-conversion
+ :family 'local
+ :service server-file))
(process-put pinentry--server-process :server-file server-file))))
(defun pinentry-stop ()