aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/26.3')
-rw-r--r--emacs/26.3/07_all_configure-decl.patch66
-rw-r--r--emacs/26.3/08_all_org-remote-unsafe.patch30
-rw-r--r--emacs/26.3/09_all_autoconf-2.72.patch24
-rw-r--r--emacs/26.3/10_all_make-info-dir.patch29
-rw-r--r--emacs/26.3/11_all_ol-expand-abbrev.patch57
5 files changed, 206 insertions, 0 deletions
diff --git a/emacs/26.3/07_all_configure-decl.patch b/emacs/26.3/07_all_configure-decl.patch
new file mode 100644
index 0000000..ac55b9f
--- /dev/null
+++ b/emacs/26.3/07_all_configure-decl.patch
@@ -0,0 +1,66 @@
+Fix implicit function declarations in configure.ac (XOpenDisplay, malloc)
+Backported from master branch
+https://bugs.gentoo.org/898304
+
+commit 6c1413d5ef0d1fea639b0d8c83a0c0065d99359b
+Author: Florian Weimer <fweimer@redhat.com>
+Date: Fri Dec 23 18:49:25 2022 +0100
+
+ configure: Remove obsolete check for -b i486-linuxaout
+
+commit 121a9ff9f6fc69066ce30c2dbe6cbfbfdca6aeaa
+Author: Florian Weimer <fweimer@redhat.com>
+Date: Fri Dec 23 18:51:08 2022 +0100
+
+ Fix alternate stack test in configure
+
+--- emacs-26.3/configure.ac
++++ emacs-26.3/configure.ac
+@@ -2421,39 +2421,6 @@
+ export LD_RUN_PATH
+ fi
+
+- if test "${opsys}" = "gnu-linux"; then
+- AC_CACHE_CHECK([whether X on GNU/Linux needs -b to link], [emacs_cv_b_link],
+- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
+- [[XOpenDisplay ("foo");]])],
+- [xgnu_linux_first_failure=no],
+- [xgnu_linux_first_failure=yes])
+- if test "${xgnu_linux_first_failure}" = "yes"; then
+- OLD_CPPFLAGS="$CPPFLAGS"
+- OLD_LIBS="$LIBS"
+- CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
+- LIBS="$LIBS -b i486-linuxaout"
+- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
+- [[XOpenDisplay ("foo");]])],
+- [xgnu_linux_second_failure=no],
+- [xgnu_linux_second_failure=yes])
+- if test "${xgnu_linux_second_failure}" = "yes"; then
+- # If we get the same failure with -b, there is no use adding -b.
+- # So leave it out. This plays safe.
+- emacs_cv_b_link=no
+- else
+- emacs_cv_b_link=yes
+- fi
+- CPPFLAGS=$OLD_CPPFLAGS
+- LIBS=$OLD_LIBS
+- else
+- emacs_cv_b_link=no
+- fi])
+- if test "x$emacs_cv_b_link" = xyes ; then
+- LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
+- C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
+- fi
+- fi
+-
+ # Reportedly, some broken Solaris systems have XKBlib.h but are missing
+ # header files included from there.
+ AC_CACHE_CHECK([for Xkb], [emacs_cv_xkb],
+@@ -4170,6 +4137,7 @@
+ [emacs_cv_alternate_stack],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <signal.h>
++ #include <stdlib.h>
+ ]],
+ [[stack_t ss;
+ struct sigaction sa;
diff --git a/emacs/26.3/08_all_org-remote-unsafe.patch b/emacs/26.3/08_all_org-remote-unsafe.patch
new file mode 100644
index 0000000..9124db5
--- /dev/null
+++ b/emacs/26.3/08_all_org-remote-unsafe.patch
@@ -0,0 +1,30 @@
+org-mode should consider remote files unsafe
+Backported from emacs-29 branch
+https://bugs.gentoo.org/927727
+
+commit 2bc865ace050ff118db43f01457f95f95112b877
+Author: Ihor Radchenko <yantar92@posteo.net>
+Date: Tue Feb 20 14:59:20 2024 +0300
+
+ org-file-contents: Consider all remote files unsafe
+
+--- emacs-26.3/lisp/org/org.el
++++ emacs-26.3/lisp/org/org.el
+@@ -5297,12 +5297,16 @@ org-file-contents
+ If NOCACHE is non-nil, do a fresh fetch of FILE even if cached version
+ is available. This option applies only if FILE is a URL."
+ (let* ((is-url (org-file-url-p file))
++ (is-remote (condition-case nil
++ (file-remote-p file)
++ ;; In case of error, be safe.
++ (t t)))
+ (cache (and is-url
+ (not nocache)
+ (gethash file org--file-cache))))
+ (cond
+ (cache)
+- (is-url
++ ((or is-url is-remote)
+ (with-current-buffer (url-retrieve-synchronously file)
+ (goto-char (point-min))
+ ;; Move point to after the url-retrieve header.
diff --git a/emacs/26.3/09_all_autoconf-2.72.patch b/emacs/26.3/09_all_autoconf-2.72.patch
new file mode 100644
index 0000000..bce8495
--- /dev/null
+++ b/emacs/26.3/09_all_autoconf-2.72.patch
@@ -0,0 +1,24 @@
+Compatibility fix for autoconf-2.72
+Patch backported from master branch
+https://bugs.gentoo.org/930502
+
+commit e34ebc0ccc6c27e7e1217baad9ca74dd7bea4c37
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Wed Feb 7 13:17:57 2024 -0800
+
+ Port better to Autoconf 2.72
+
+ * configure.ac: Set ac_cv_type_gid_t=yes to pacify Autoconf 2.72
+ AC_TYPE_GETGROUPS. Problem reported by Nick Bowler in:
+ https://lists.gnu.org/r/autoconf-patches/2024-02/msg00001.html
+
+--- emacs-26.3/configure.ac
++++ emacs-26.3/configure.ac
+@@ -1538,6 +1538,7 @@
+ AC_DEFUN([AC_TYPE_SIZE_T])
+ # Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them.
+ AC_DEFUN([AC_TYPE_UID_T])
++ac_cv_type_gid_t=yes # AC_TYPE_GETGROUPS needs this in Autoconf 2.72.
+
+ # sqrt and other floating-point functions such as fmod and frexp
+ # are found in -lm on many systems.
diff --git a/emacs/26.3/10_all_make-info-dir.patch b/emacs/26.3/10_all_make-info-dir.patch
new file mode 100644
index 0000000..b7b911a
--- /dev/null
+++ b/emacs/26.3/10_all_make-info-dir.patch
@@ -0,0 +1,29 @@
+Make it build with mksh
+Patch from emacs-29 branch
+https://bugs.gentoo.org/930086
+https://debbugs.gnu.org/70484
+
+commit 42766f95e5c0e7eb9e21db964ed93c7e093cc0b9
+Author: Ulrich Müller <ulm@gentoo.org>
+Date: Tue Apr 23 07:37:17 2024 +0200
+
+ * build-aux/make-info-dir: Avoid bashism (bug#70484).
+
+--- emacs-26.3/build-aux/make-info-dir
++++ emacs-26.3/build-aux/make-info-dir
+@@ -33,7 +33,8 @@
+
+ ## Header contains non-printing characters, so this is more
+ ## reliable than using awk.
+-cat <"${1?}" || exit
++test $# -ge 2 || exit 1
++cat <"$1"
+ shift
+
+ exec "${AWK-awk}" '
+@@ -71,4 +72,4 @@
+ if (data[dircat])
+ printf "\n%s\n%s", topic[dircat], data[dircat]
+ }
+-' "${@?}"
++' "$@"
diff --git a/emacs/26.3/11_all_ol-expand-abbrev.patch b/emacs/26.3/11_all_ol-expand-abbrev.patch
new file mode 100644
index 0000000..9c5d2ce
--- /dev/null
+++ b/emacs/26.3/11_all_ol-expand-abbrev.patch
@@ -0,0 +1,57 @@
+org-mode should not expand link abbrevs that specify an unsafe function
+Backported from emacs-29 branch
+
+commit c645e1d8205f0f0663ec4a2d27575b238c646c7c
+Author: Ihor Radchenko <yantar92@posteo.net>
+Date: Fri Jun 21 15:45:25 2024 +0200
+
+ org-link-expand-abbrev: Do not evaluate arbitrary unsafe Elisp code
+
+--- emacs-26.3/lisp/org/org.el
++++ emacs-26.3/lisp/org/org.el
+@@ -9589,16 +9589,35 @@
+ (if (not as)
+ link
+ (setq rpl (cdr as))
+- (cond
+- ((symbolp rpl) (funcall rpl tag))
+- ((string-match "%(\\([^)]+\\))" rpl)
+- (replace-match
+- (save-match-data
+- (funcall (intern-soft (match-string 1 rpl)) tag)) t t rpl))
+- ((string-match "%s" rpl) (replace-match (or tag "") t t rpl))
+- ((string-match "%h" rpl)
+- (replace-match (url-hexify-string (or tag "")) t t rpl))
+- (t (concat rpl tag)))))
++ ;; Drop any potentially dangerous text properties like
++ ;; `modification-hooks' that may be used as an attack vector.
++ (substring-no-properties
++ (cond
++ ((symbolp rpl) (funcall rpl tag))
++ ((string-match "%(\\([^)]+\\))" rpl)
++ (let ((rpl-fun-symbol (intern-soft (match-string 1 rpl))))
++ ;; Using `unsafep-function' is not quite enough because
++ ;; Emacs considers functions like `genenv' safe, while
++ ;; they can potentially be used to expose private system
++ ;; data to attacker if abbreviated link is clicked.
++ (if (or (eq t (get rpl-fun-symbol 'org-link-abbrev-safe))
++ (eq t (get rpl-fun-symbol 'pure)))
++ (replace-match
++ (save-match-data
++ (funcall (intern-soft (match-string 1 rpl)) tag))
++ t t rpl)
++ (org-display-warning
++ (format "Disabling unsafe link abbrev: %s
++You may mark function safe via (put '%s 'org-link-abbrev-safe t)"
++ rpl (match-string 1 rpl)))
++ (setq org-link-abbrev-alist-local (delete as org-link-abbrev-alist-local)
++ org-link-abbrev-alist (delete as org-link-abbrev-alist))
++ link
++ )))
++ ((string-match "%s" rpl) (replace-match (or tag "") t t rpl))
++ ((string-match "%h" rpl)
++ (replace-match (url-hexify-string (or tag "")) t t rpl))
++ (t (concat rpl tag))))))
+ link))
+
+ ;;; Storing and inserting links