[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master dcc9ba0 11/11: Set file modes of pinentry socket for extra
From: |
Nicolas Petton |
Subject: |
[elpa] master dcc9ba0 11/11: Set file modes of pinentry socket for extra safety |
Date: |
Tue, 16 Jan 2018 08:01:46 -0500 (EST) |
branch: master
commit dcc9ba03252ee5d39e03bba31b420e0708c3ba0c
Author: Daiki Ueno <address@hidden>
Commit: Nicolas Petton <address@hidden>
Set file modes of pinentry socket for extra safety
* pinentry.el: Require 'cl-lib for `cl-letf'.
(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'.
---
packages/pinentry/pinentry.el | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/packages/pinentry/pinentry.el b/packages/pinentry/pinentry.el
index d7dca4a..50ea614 100644
--- a/packages/pinentry/pinentry.el
+++ b/packages/pinentry/pinentry.el
@@ -49,6 +49,8 @@
;;; Code:
+(eval-when-compile (require 'cl-lib))
+
(defgroup pinentry nil
"The Pinentry server"
:version "25.1"
@@ -172,17 +174,18 @@ 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))
- (process-put pinentry--server-process :server-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))
+ (process-put pinentry--server-process :server-file server-file)))))
(defun pinentry-stop ()
"Stop a Pinentry service."
- [elpa] master adc04d8 03/11: pinentry.el: Support external passphrase cache, (continued)
- [elpa] master adc04d8 03/11: pinentry.el: Support external passphrase cache, Nicolas Petton, 2018/01/16
- [elpa] master efb0175 09/11: Change the default socket location for pinentry, Nicolas Petton, 2018/01/16
- [elpa] master b2dbb4c 10/11: Revert "Change the default socket location for pinentry", Nicolas Petton, 2018/01/16
- [elpa] master 19227a0 02/11: ; pinentry.el: Update header comment and fix typos, Nicolas Petton, 2018/01/16
- [elpa] master 1cfcece 01/11: packages/pinentry/pinentry.el: Popup window for multiline prompt, Nicolas Petton, 2018/01/16
- [elpa] master 2a2617f 04/11: Revert "pinentry.el: Support external passphrase cache", Nicolas Petton, 2018/01/16
- [elpa] master 32bec2a 06/11: pinentry.el: Add debugging support, Nicolas Petton, 2018/01/16
- [elpa] master 7154adf 05/11: pinentry.el: Improve multiline prompt, Nicolas Petton, 2018/01/16
- [elpa] master cd62826 08/11: Mention how to enable pinentry feature, Nicolas Petton, 2018/01/16
- [elpa] master 952dd9f 07/11: Suppress redundant Pinentry startup messages, Nicolas Petton, 2018/01/16
- [elpa] master dcc9ba0 11/11: Set file modes of pinentry socket for extra safety,
Nicolas Petton <=