From d71764e3029f28121e911c0664a8cb9ba41dfcb3 Mon Sep 17 00:00:00 2001 From: Jacek Migacz Date: Mon, 23 Jun 2025 11:28:00 +0200 Subject: [PATCH] Introduce untrusted-content variable Resolves: RHEL-94297 --- emacs-untrusted-content.patch | 33 +++++++++++++++++++++++++++++++++ emacs.spec | 3 +++ 2 files changed, 36 insertions(+) create mode 100644 emacs-untrusted-content.patch diff --git a/emacs-untrusted-content.patch b/emacs-untrusted-content.patch new file mode 100644 index 0000000..7fae519 --- /dev/null +++ b/emacs-untrusted-content.patch @@ -0,0 +1,33 @@ +From ccc188fcf98ad9166ee551fac9d94b2603c3a51b Mon Sep 17 00:00:00 2001 +From: Ihor Radchenko +Date: Tue, 20 Feb 2024 12:43:51 +0300 +Subject: * lisp/files.el (untrusted-content): New variable. + +The new variable is to be used when buffer contents comes from untrusted +source. +--- + lisp/files.el | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/lisp/files.el b/lisp/files.el +index c0d26b2343c..5536af014f6 100644 +--- a/lisp/files.el ++++ b/lisp/files.el +@@ -695,6 +695,14 @@ Also see the `permanently-enabled-local-variables' variable." + Some modes may wish to set this to nil to prevent directory-local + settings being applied, but still respect file-local ones.") + ++(defvar-local untrusted-content nil ++ "Non-nil means that current buffer originated from an untrusted source. ++Email clients and some other modes may set this non-nil to mark the ++buffer contents as untrusted. ++ ++This variable might be subject to change without notice.") ++(put 'untrusted-content 'permanent-local t) ++ + (defcustom trusted-content nil + "List of files and directories whose content we trust. + Be extra careful here since trusting means that Emacs might execute the +-- +cgit v1.2.3 + diff --git a/emacs.spec b/emacs.spec index c303c23..841f370 100644 --- a/emacs.spec +++ b/emacs.spec @@ -44,6 +44,7 @@ Patch16: emacs-pong-and-tetris-are-excluded.patch Patch17: emacs-fix-flymake-tests-with-gcc-14.patch Patch18: emacs-nsm-should-check.patch Patch19: emacs-tests-for-tetris.patch +Patch20: emacs-untrusted-content.patch BuildRequires: gcc BuildRequires: atk-devel @@ -222,6 +223,7 @@ Development header files for Emacs. %patch -P 17 -p1 -b .fix-flymake-tests-with-gcc-14 %patch -P 18 -p1 -b .nsm-should-check %patch -P 19 -p1 -b .tests-for-tetris +%patch -P 20 -p1 -b .untrusted-content # Avoid trademark issues rm lisp/play/pong.el lisp/play/pong.elc \ @@ -511,6 +513,7 @@ rm %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document23.svg * Mon Jun 23 2025 Jacek Migacz - 1:27.2-18 - Fix nsm-should-check for "google.com" failure (RHEL-94297) - Fix package tests for tetris no longer existing as a package (RHEL-94297) +- Introduce untrusted-content variable (RHEL-94297) * Wed Jun 18 2025 Jacek Migacz - 1:27.2-17 - Pong and Tetris are excluded (RHEL-94297)