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

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

[nongnu] elpa/undo-fu-session 39f9b1997e 13/53: Ignore encrypted files b


From: ELPA Syncer
Subject: [nongnu] elpa/undo-fu-session 39f9b1997e 13/53: Ignore encrypted files by default
Date: Thu, 7 Jul 2022 12:05:16 -0400 (EDT)

branch: elpa/undo-fu-session
commit 39f9b1997e5f1118b8f9c027712effa340cae074
Author: Tyler Ware <tyler.ware.777@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Ignore encrypted files by default
    
    Saving undo history for encrypted files is a somewhat
    unexpected behavior and is a bit of a security hole.
    This commit adds the default that inhibits a session
    for an encrypted file.
---
 undo-fu-session.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/undo-fu-session.el b/undo-fu-session.el
index 7ac0f256aa..b329bef63e 100644
--- a/undo-fu-session.el
+++ b/undo-fu-session.el
@@ -69,6 +69,11 @@
   :group 'undo-fu-session
   :type 'string)
 
+(defcustom undo-fu-session-ignore-encrypted-files t
+  "Ignore encrypted files for undo session."
+  :group 'undo-fu-session
+  :type 'boolean)
+
 (defcustom undo-fu-session-compression t
   "Store files compressed."
   :group 'undo-fu-session
@@ -354,6 +359,12 @@ Argument PENDING-LIST an `pending-undo-list'. compatible 
list."
     (cond
       ((null filename)
         nil)
+      ( ;; Ignore encryped files.
+        (and
+          undo-fu-session-ignore-encrypted-files
+          epa-file-handler
+          (string-match-p (car epa-file-handler) filename))
+        nil)
       ((and test-files (undo-fu-session--match-file-name filename test-files))
         nil)
       ((and test-modes (memq (buffer-local-value 'major-mode buffer) 
test-modes))



reply via email to

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