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

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

[nongnu] elpa/hyperdrive-org-transclusion 7e184311b0 32/38: Security: On


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive-org-transclusion 7e184311b0 32/38: Security: Only transclude content from safe hyperdrives
Date: Mon, 23 Sep 2024 04:01:33 -0400 (EDT)

branch: elpa/hyperdrive-org-transclusion
commit 7e184311b0a31376a28c1aa2926a473bae2cc298
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>

    Security: Only transclude content from safe hyperdrives
---
 hyperdrive-org-transclusion.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hyperdrive-org-transclusion.el b/hyperdrive-org-transclusion.el
index d312ae274c..902d262fbb 100644
--- a/hyperdrive-org-transclusion.el
+++ b/hyperdrive-org-transclusion.el
@@ -80,6 +80,18 @@ PLIST, COPY."
                ((cl-struct hyperdrive-entry hyperdrive path etc) entry)
                ((map target) etc)
                (tc-type))
+    (when (eq 'unknown (hyperdrive-safe-p hyperdrive))
+      (let ((hyperdrive-current-entry
+             (hyperdrive-entry-create :hyperdrive hyperdrive)))
+        (call-interactively #'hyperdrive-mark-as-safe)))
+    ;; Check safe-p again after potential call to `hyperdrive-mark-as-safe'.
+    (unless (eq t (hyperdrive-safe-p hyperdrive))
+      (user-error
+       (substitute-command-keys
+        "hyperdrive-org-transclusion:  Refused to transclude hyperdrive 
content not marked as safe:
+<%s>
+Try \\[hyperdrive-mark-as-safe]")
+       raw-link))
     (when (hyperdrive--entry-directory-p entry)
       (user-error "hyperdrive-org-transclusion:  Directory transclusion not 
supported: <%s>"
                   raw-link))



reply via email to

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