emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/undo-fu-session cbe37c6643 31/53: Alternate fix for #2, ma


From: ELPA Syncer
Subject: [nongnu] elpa/undo-fu-session cbe37c6643 31/53: Alternate fix for #2, make the directory only readable by the user
Date: Thu, 7 Jul 2022 12:05:21 -0400 (EDT)

branch: elpa/undo-fu-session
commit cbe37c664389e2ef8c580dd800ca76b0139f09c5
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Alternate fix for #2, make the directory only readable by the user
---
 changelog.rst      | 2 +-
 undo-fu-session.el | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/changelog.rst b/changelog.rst
index 3b5112fd9e..9a0a34041c 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -5,7 +5,7 @@ Change Log
 
 - In development
 
-  - Write files so only the owner can read them (to avoid potential security 
issues).
+  - Set permissions on the directory only only be readable by the owner (to 
avoid potential security issues).
   - Disable ``global-undo-fu-session`` in ``special-mode`` and it's derived 
modes (such as ``package-menu-mode``).
   - Add ``undo-fu-session-ignore-encrypted-files`` to ignore encrypted files.
   - Fix bug when ``undo-fu-session-linear`` was enabled,
diff --git a/undo-fu-session.el b/undo-fu-session.el
index f847fed568..8ad09c2f3d 100644
--- a/undo-fu-session.el
+++ b/undo-fu-session.el
@@ -470,8 +470,6 @@ Argument PENDING-LIST an `pending-undo-list' compatible 
list."
           (write-char ?\n (current-buffer))
           (prin1 content-data (current-buffer))
           (write-region nil nil undo-file nil 0)
-          ;; This file should only readable by the owner, see #2.
-          (set-file-modes undo-file #o600)
           t)))))
 
 (defun undo-fu-session-save-safe ()
@@ -588,7 +586,9 @@ Argument PENDING-LIST an `pending-undo-list' compatible 
list."
 (defun undo-fu-session-mode-enable ()
   "Turn on 'undo-fu-session-mode' for the current buffer."
   (unless (file-directory-p undo-fu-session-directory)
-    (make-directory undo-fu-session-directory t))
+    (make-directory undo-fu-session-directory t)
+    ;; These files should only readable by the owner, see #2.
+    (set-file-modes undo-fu-session-directory #o700))
   (add-hook 'before-save-hook #'undo-fu-session-save-safe)
   (add-hook 'find-file-hook #'undo-fu-session-recover-safe))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]