[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pinentry 075fa1d 16/18: Change the default socket locat
From: |
Stefan Monnier |
Subject: |
[elpa] externals/pinentry 075fa1d 16/18: Change the default socket location for pinentry |
Date: |
Sat, 28 Nov 2020 00:07:49 -0500 (EST) |
branch: externals/pinentry
commit 075fa1d56371185635d3346e3cba2ad6aebdc75f
Author: Daiki Ueno <ueno@gnu.org>
Commit: Daiki Ueno <ueno@gnu.org>
Change the default socket location for pinentry
* pinentry.el: Require 'cl-lib for `cl-letf'.
(pinentry--socket-dir): Change the default from /tmp/emacsXXX to
~/.emacs.d/pinentry.
(pinentry-start): Change the file modes of the socket file to 0700.
This is just for extra safety since the parent directory is already
protected with `server-ensure-safe-dir'.
---
pinentry.el | 41 ++++++++++++++++++++---------------------
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/pinentry.el b/pinentry.el
index d7dca4a..9e23155 100644
--- a/pinentry.el
+++ b/pinentry.el
@@ -26,6 +26,9 @@
;; 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.
@@ -38,17 +41,15 @@
;; where pinentry and Emacs communicate through a Unix domain socket
;; created at:
;;
-;; ${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").
+;; ~/.emacs.d/pinentry/pinentry
;;
-;; NOTE: As of August 2015, this feature requires newer versions of
-;; GnuPG (2.1.5+) and Pinentry (0.9.5+).
+;; The protocol is a subset of the Pinentry Assuan protocol described
+;; in (info "(pinentry) Protocol").
;;; Code:
+(eval-when-compile (require 'cl-lib))
+
(defgroup pinentry nil
"The Pinentry server"
:version "25.1"
@@ -76,10 +77,7 @@
(defvar pinentry--prompt-buffer nil)
-;; 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))
+(defvar pinentry--socket-dir (locate-user-emacs-file "pinentry")
"The directory in which to place the server socket.
If local sockets are not supported, this is nil.")
@@ -172,16 +170,17 @@ will not be shown."
(ignore-errors
(let (delete-by-moving-to-trash)
(delete-file 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))
+ (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)))
(process-put pinentry--server-process :server-file server-file))))
(defun pinentry-stop ()
- [elpa] externals/pinentry 398bb40 10/18: pinentry.el: Support external passphrase cache, (continued)
- [elpa] externals/pinentry 398bb40 10/18: pinentry.el: Support external passphrase cache, Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry b3a45a5 07/18: Move the content of README to pinentry.el, Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry 99be264 08/18: pinentry.el: Popup window for multiline prompt, Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry 3b6383e 14/18: Suppress redundant Pinentry startup messages, Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry 3f3150b 15/18: Mention how to enable pinentry feature, Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry 9e64733 09/18: ; pinentry.el: Update header comment and fix typos, Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry 908344f 05/18: Add more documentation and fix mnemonic handling, Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry ee7d272 11/18: Revert "pinentry.el: Support external passphrase cache", Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry f6785ae 12/18: pinentry.el: Improve multiline prompt, Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry 33aa267 13/18: pinentry.el: Add debugging support, Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry 075fa1d 16/18: Change the default socket location for pinentry,
Stefan Monnier <=
- [elpa] externals/pinentry 379bbeb 17/18: Revert "Change the default socket location for pinentry", Stefan Monnier, 2020/11/28
- [elpa] externals/pinentry 0f42e75 18/18: Set file modes of pinentry socket for extra safety, Stefan Monnier, 2020/11/28