Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package emacs for openSUSE:Factory checked 
in at 2026-11-27 21:03:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/emacs (Old)
 and      /work/SRC/openSUSE:Factory/.emacs.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "emacs"

Fri Nov 27 21:03:00 2026 rev:229 rq:1400745 version:31.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/emacs/emacs.changes      2026-11-03 
17:52:15.010006052 +0100
+++ /work/SRC/openSUSE:Factory/.emacs.new.1340718/emacs.changes 2026-11-27 
21:03:20.201359276 +0100
@@ -1,0 +2,10 @@
+Tue Nov 24 16:00:47 UTC 2026 - Jan Fooken <[email protected]>
+
+- Add patch emacs-31-ace-dir-locals.patch
+  * Fix bsc#1290800 (CVE-2026-131959): arbitrary code execution via
+    crafted directory-local configuration
+- Add patch emacs-31-regression-set-auto-mode.patch
+  * Fix regression introduced by patch
+    emacs-31-ace-dir-locals.patch
+
+-------------------------------------------------------------------

New:
----
  emacs-31-ace-dir-locals.patch
  emacs-31-regression-set-auto-mode.patch

----------(New B)----------
  New:
- Add patch emacs-31-ace-dir-locals.patch
  * Fix bsc#1290800 (CVE-2026-131959): arbitrary code execution via
  New:    crafted directory-local configuration
- Add patch emacs-31-regression-set-auto-mode.patch
  * Fix regression introduced by patch
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ emacs.spec ++++++
--- /var/tmp/diff_new_pack.YoSGBx/_old  2026-11-27 21:03:22.092438729 +0100
+++ /var/tmp/diff_new_pack.YoSGBx/_new  2026-11-27 21:03:22.096438897 +0100
@@ -262,6 +262,8 @@
 Patch57:        emacs-30.2-fix-zoom.patch
 Patch58:        bsc1282390.patch
 Patch59:        emacs-bsc1284345.patch
+Patch60:        emacs-31-ace-dir-locals.patch
+Patch61:        emacs-31-regression-set-auto-mode.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %{expand: %%global include_info %(test -s /usr/share/info/info.info* && echo 0 
|| echo 1)}
@@ -438,6 +440,8 @@
 %patch -P57 -p1
 %patch -P58 -p1
 %patch -P59 -p1
+%patch -P60 -p1
+%patch -P61 -p1
 %patch -P1  -p0 -b .xauth
 %if %{with memmmap}
 %patch -P2  -p0 -b .glibc

++++++ emacs-31-ace-dir-locals.patch ++++++
>From 205ae0b0583dbfe09e258164adbc49e130645221 Mon Sep 17 00:00:00 2001
From: Stefan Monnier <[email protected]>
Date: Wed, 11 Nov 2026 09:29:24 +0000
Subject: Fix arbitrary code execution in .dir-locals.el handling

* lisp/files.el (set-auto-mode--find-matching-alist-entry):
Rename to ...
(set-auto-mode--from-matching-alist-entry): ... this.
(set-auto-mode--from-matching-alist-entry)
(set-auto-mode--apply-alist): Address arbitrary code execution
vulnerability (bug#82213).
---
 lisp/files.el | 82 ++++++++++++++++++++++++++---------------------------------
 1 file changed, 36 insertions(+), 46 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 0d0db4024ee..c2b6db8bf2f 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3507,44 +3507,42 @@ If FUNCTION is nil, then it is not called.")
   "Upper limit on `magic-mode-alist' regexp matches.
 Also applies to `magic-fallback-mode-alist'.")
 
-(defun set-auto-mode--find-matching-alist-entry (alist name case-insensitive)
+(defun set-auto-mode--from-matching-alist-entry ( alist name case-insensitive
+                                                  keep-mode-if-same dir-local)
   "Find first matching entry in ALIST for file NAME.
 
 If CASE-INSENSITIVE, the file system of file NAME is case-insensitive."
-  (let (mode)
-    (while name
-      (let ((newmode
-             (if case-insensitive
-                 ;; Filesystem is case-insensitive.
-                 (let ((case-fold-search t))
-                   (assoc-default name alist 'string-match))
-               ;; Filesystem is case-sensitive.
-               (or
-                ;; First match case-sensitively.
-                (let ((case-fold-search nil))
-                  (assoc-default name alist 'string-match))
-                ;; Fallback to case-insensitive match.
-                (and auto-mode-case-fold
-                     (let ((case-fold-search t))
-                       (assoc-default name alist 'string-match)))))))
-        (when newmode
-          (when mode
-            ;; We had already found a mode but in a (REGEXP MODE t)
-            ;; entry, so we still have to run MODE.  Let's do it now.
-            ;; FIXME: It's kind of ugly to run the function here.
-            ;; An alternative could be to return a list of functions and
-            ;; callers.
-            (set-auto-mode-0 mode t))
-          (setq mode newmode))
-        (if (and newmode
-                 (not (functionp newmode))
-                 (consp newmode)
-                 (cadr newmode))
-            ;; It's a (REGEXP MODE t): Keep looking but remember the MODE.
-            (setq mode (car newmode)
-                  name (substring name 0 (match-beginning 0)))
-          (setq name nil))))
-    mode))
+  (let (was-set)
+    (while
+        (let* ((newmode
+                (if case-insensitive
+                    ;; Filesystem is case-insensitive.
+                    (let ((case-fold-search t))
+                      (assoc-default name alist 'string-match))
+                  ;; Filesystem is case-sensitive.
+                  (or
+                   ;; First match case-sensitively.
+                   (let ((case-fold-search nil))
+                     (assoc-default name alist 'string-match))
+                   ;; Fallback to case-insensitive match.
+                   (and auto-mode-case-fold
+                        (let ((case-fold-search t))
+                          (assoc-default name alist 'string-match))))))
+               ;; Extract MODE from (REGEXP MODE t) entries.
+               (mode-t (when (and (not (functionp newmode))
+                                  (consp newmode)
+                                  (cadr newmode))
+                         (setq name (substring name 0 (match-beginning 0)))
+                         (car newmode)))
+               (mode (or mode-t newmode)))
+          (when newmode
+            (if (and dir-local
+                     (not (set-auto-mode--dir-local-valid-p mode)))
+                (message "Ignoring invalid mode `%S'" mode)
+              (set-auto-mode-0 mode keep-mode-if-same)
+              (setq was-set t))
+            mode-t)))
+    was-set))
 
 (defun set-auto-mode--apply-alist (alist keep-mode-if-same dir-local)
   "Helper function for `set-auto-mode'.
@@ -3556,8 +3554,7 @@ Return non-nil if the mode was set, nil otherwise.
 DIR-LOCAL non-nil means this call is via directory-locals, and
 extra checks should be done."
   (if buffer-file-name
-      (let (mode
-            (name buffer-file-name)
+      (let ((name buffer-file-name)
             (remote-id (file-remote-p buffer-file-name))
             (case-insensitive-p (file-name-case-insensitive-p
                                  buffer-file-name)))
@@ -3567,15 +3564,8 @@ extra checks should be done."
         (when (and (stringp remote-id)
                    (string-match (regexp-quote remote-id) name))
           (setq name (substring name (match-end 0))))
-        (setq mode (set-auto-mode--find-matching-alist-entry
-                    alist name case-insensitive-p))
-        (when (and dir-local mode
-                   (not (set-auto-mode--dir-local-valid-p mode)))
-          (message "Ignoring invalid mode `%S'" mode)
-          (setq mode nil))
-        (when mode
-          (set-auto-mode-0 mode keep-mode-if-same)
-          t))))
+        (set-auto-mode--from-matching-alist-entry
+         alist name case-insensitive-p keep-mode-if-same dir-local))))
 
 (defun set-auto-mode--dir-local-valid-p (mode)
   "Say whether MODE can be used in a .dir-local.el `auto-mode-alist'."
-- 
cgit v1.2.3


++++++ emacs-31-regression-set-auto-mode.patch ++++++
>From 5bf385dad6e5a2c2a9584252b99484cdbfeae66b Mon Sep 17 00:00:00 2001
From: Stefan Monnier <[email protected]>
Date: Sun, 15 Nov 2026 18:15:49 -0500
Subject: (set-auto-mode): Fix regression in commit 205ae0b0583d

* lisp/files.el (set-auto-mode--from-matching-alist-entry): Handle nil
modes in (REGEXP MODE NON-NIL) entries.

* test/lisp/files-tests.el (files-tests--check-mode): Adjust to
disappearance of 'set-auto-mode--find-matching-alist-entry'.
Add entry for 'foo.el.orig' to test handling of nil MODEs.
---
 lisp/files.el            | 28 ++++++++++++++--------------
 test/lisp/files-tests.el | 11 +++++++----
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index c2b6db8bf2f..7cf424d971b 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3527,21 +3527,21 @@ If CASE-INSENSITIVE, the file system of file NAME is 
case-insensitive."
                    ;; Fallback to case-insensitive match.
                    (and auto-mode-case-fold
                         (let ((case-fold-search t))
-                          (assoc-default name alist 'string-match))))))
-               ;; Extract MODE from (REGEXP MODE t) entries.
-               (mode-t (when (and (not (functionp newmode))
-                                  (consp newmode)
-                                  (cadr newmode))
-                         (setq name (substring name 0 (match-beginning 0)))
-                         (car newmode)))
-               (mode (or mode-t newmode)))
+                         (assoc-default name alist 'string-match)))))))
           (when newmode
-            (if (and dir-local
-                     (not (set-auto-mode--dir-local-valid-p mode)))
-                (message "Ignoring invalid mode `%S'" mode)
-              (set-auto-mode-0 mode keep-mode-if-same)
-              (setq was-set t))
-            mode-t)))
+            (let* ((mode-t ;; Is it a (REGEXP MODE NON-NIL) entry?
+                    (and (not (functionp newmode))
+                         (consp newmode) (cadr newmode)))
+                   (mode (if (null mode-t) newmode
+                           (setq name (substring name 0 (match-beginning 0)))
+                           (car newmode))))
+              (when mode
+                (if (and dir-local
+                         (not (set-auto-mode--dir-local-valid-p mode)))
+                    (message "Ignoring invalid mode `%S'" mode)
+                  (set-auto-mode-0 mode keep-mode-if-same)
+                  (setq was-set t)))
+              mode-t))))
     was-set))
 
 (defun set-auto-mode--apply-alist (alist keep-mode-if-same dir-local)
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index d7ae7e3ea5f..ba303c46b3a 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1780,12 +1780,15 @@ The door of all subtleties!
 
 (defun files-tests--check-mode (filename)
   "Return the major mode found in `auto-mode-alist' for FILENAME."
-  (set-auto-mode--find-matching-alist-entry
-   auto-mode-alist
-   (concat "/home/jrhacker/" filename)
-   nil))
+  (with-temp-buffer
+    (set-auto-mode--from-matching-alist-entry
+     auto-mode-alist
+     (concat "/home/jrhacker/" filename)
+     nil t nil)
+    major-mode))
 
 (ert-deftest files-tests-auto-mode-alist ()
+  (should (eq (files-tests--check-mode "foo.el.orig") #'emacs-lisp-mode))
   (should (eq (files-tests--check-mode ".gdbinit.in") #'gdb-script-mode))
   (should (eq (files-tests--check-mode ".gdbinit") #'gdb-script-mode))
   (should (eq (files-tests--check-mode "_gdbinit") #'gdb-script-mode)) ; for 
MS-DOS
-- 
cgit v1.2.3

Reply via email to