diff --git a/SPECS/ncurses/ncurses.signatures.json b/SPECS/ncurses/ncurses.signatures.json index 5055a48300..79b42138de 100644 --- a/SPECS/ncurses/ncurses.signatures.json +++ b/SPECS/ncurses/ncurses.signatures.json @@ -1,5 +1,5 @@ { "Signatures": { - "ncurses-6.4-20230408.tgz": "46030c04cfb60433db05631e8124640acff284b1d3b9c897ff661686d885e0e8" + "ncurses-6.4-20230423.tgz": "7d77f95eff470099cfb7cabd6d3b8766ee1c4bda33755dd5a4d73fcc85315a4f" } } \ No newline at end of file diff --git a/SPECS/ncurses/ncurses.spec b/SPECS/ncurses/ncurses.spec index 36212e6cd8..38301799be 100644 --- a/SPECS/ncurses/ncurses.spec +++ b/SPECS/ncurses/ncurses.spec @@ -1,9 +1,9 @@ -%global patchlevel 20230408 +%global patchlevel 20230423 Summary: Libraries for terminal handling of character screens Name: ncurses Version: 6.4 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT Vendor: Microsoft Corporation Distribution: Mariner @@ -233,6 +233,9 @@ xz NEWS %files term -f terms.term %changelog +* Thu Nov 16 2023 Tobias Brick - 6.4-2 +- Update to version 6.4-20230423 to fix crash in tmux + * Wed Apr 26 2023 Sindhu Karri - 6.4-1 - Update to version 6.4-20230408 to fix CVE-2023-29491 diff --git a/SPECS/tmux/manual-patch-to-fix-crash-due-to-change-to-ncurses.patch b/SPECS/tmux/manual-patch-to-fix-crash-due-to-change-to-ncurses.patch new file mode 100644 index 0000000000..e1bdfa68d9 --- /dev/null +++ b/SPECS/tmux/manual-patch-to-fix-crash-due-to-change-to-ncurses.patch @@ -0,0 +1,90 @@ +From 8bec5e2d2e5a6c77ce3c2ec2c38e658efc6fc26f Mon Sep 17 00:00:00 2001 +From: Tobias Brick +Date: Thu, 26 Oct 2023 17:23:48 +0000 +Subject: [PATCH] Manual patch to fix crash due to change to ncurses + +ncurses-6.4-20230408 change tparm to require cur_term, which broke tmux usage of it. + +ncurses-6.4-20230423 then added tiparm_s that allows usage without cur_term. + +tmux change https://github.com/tmux/tmux/commit/39d41d0810d4e8ae6ce8d27776dfbb96722d9319 uses tiparm_s if it exists, but cannot be cleanly applied to tmux tag 3.2a. + +That change uses a config setting to created #defines to determine which version of tparm it should use, and only conditionally uses tiparm_s, because it needs to be backwards compatible with previous versions of ncurses. + +But to use that, we would need to get the actual source as it appears in github, rather than the released version (they are different downloads: see https://github.com/tmux/tmux/releases). + +Fortunately, we have the luxury of forcing tmux to use a version of ncurses that has the function we want (see above). + +Given all this, this patch takes the change to use tiparm_s, removes the conditional compilation portion so it always uses tiparm_s and applies it to the code as it exists in 3.2a. + +It has both a build-time and run-time dependency on ncurses-6.4-20230423 or later. +--- + tty-term.c | 30 +++++++++++++++++++++++++----- + 1 file changed, 25 insertions(+), 5 deletions(-) + +diff --git a/tty-term.c b/tty-term.c +index add71d89..a5ed1d77 100644 +--- a/tty-term.c ++++ b/tty-term.c +@@ -761,33 +761,53 @@ tty_term_string(struct tty_term *term, enum tty_code_code code) + const char * + tty_term_string1(struct tty_term *term, enum tty_code_code code, int a) + { +- return (tparm((char *) tty_term_string(term, code), a, 0, 0, 0, 0, 0, 0, 0, 0)); ++ const char *x = tty_term_string(term, code), *s; ++ s = tiparm_s(1, 0, x, a); ++ if (s == NULL) ++ fatalx("could not expand %s", tty_term_codes[code].name); ++ return (s); + } + + const char * + tty_term_string2(struct tty_term *term, enum tty_code_code code, int a, int b) + { +- return (tparm((char *) tty_term_string(term, code), a, b, 0, 0, 0, 0, 0, 0, 0)); ++ const char *x = tty_term_string(term, code), *s; ++ s = tiparm_s(2, 0, x, a, b); ++ if (s == NULL) ++ fatalx("could not expand %s", tty_term_codes[code].name); ++ return (s); + } + + const char * + tty_term_string3(struct tty_term *term, enum tty_code_code code, int a, int b, + int c) + { +- return (tparm((char *) tty_term_string(term, code), a, b, c, 0, 0, 0, 0, 0, 0)); ++ const char *x = tty_term_string(term, code), *s; ++ s = tiparm_s(3, 0, x, a, b, c); ++ if (s == NULL) ++ fatalx("could not expand %s", tty_term_codes[code].name); ++ return (s); + } + + const char * + tty_term_ptr1(struct tty_term *term, enum tty_code_code code, const void *a) + { +- return (tparm((char *) tty_term_string(term, code), (long)a, 0, 0, 0, 0, 0, 0, 0, 0)); ++ const char *x = tty_term_string(term, code), *s; ++ s = tiparm_s(1, 1, x, a); ++ if (s == NULL) ++ fatalx("could not expand %s", tty_term_codes[code].name); ++ return (s); + } + + const char * + tty_term_ptr2(struct tty_term *term, enum tty_code_code code, const void *a, + const void *b) + { +- return (tparm((char *) tty_term_string(term, code), (long)a, (long)b, 0, 0, 0, 0, 0, 0, 0)); ++ const char *x = tty_term_string(term, code), *s; ++ s = tiparm_s(2, 3, x, a, b); ++ if (s == NULL) ++ fatalx("could not expand %s", tty_term_codes[code].name); ++ return (s); + } + + int +-- +2.33.8 + diff --git a/SPECS/tmux/tmux.spec b/SPECS/tmux/tmux.spec index af94042e01..76dade7374 100644 --- a/SPECS/tmux/tmux.spec +++ b/SPECS/tmux/tmux.spec @@ -1,7 +1,7 @@ Summary: Terminal multiplexer Name: tmux Version: 3.2a -Release: 3%{?dist} +Release: 4%{?dist} License: ISC and BSD URL: https://tmux.github.io/ Group: Applications/System @@ -9,8 +9,11 @@ Vendor: Microsoft Corporation Distribution: Mariner Source0: https://github.com/tmux/tmux/releases/download/%{version}/%{name}-%{version}.tar.gz Patch0: CVE-2022-47016.patch -Requires: libevent ncurses -BuildRequires: libevent-devel ncurses-devel +Patch1: manual-patch-to-fix-crash-due-to-change-to-ncurses.patch +Requires: libevent +Requires: ncurses >= 6.4-2 +BuildRequires: libevent-devel +BuildRequires: ncurses-devel >= 6.4-2 %description Terminal multiplexer @@ -38,6 +41,10 @@ make %{?_smp_mflags} check %exclude /usr/src %changelog +* Thu Nov 16 2023 Tobias Brick - 3.2a-4 +- Add dependency on ncurses >= 6.4-2 +- Patch to fix crash due to kprevious change to ncurses + * Fri Feb 10 2023 Rachel Menge - 3.2a-3 - Patch CVE-2022-47016 diff --git a/cgmanifest.json b/cgmanifest.json index 3fac0e9529..5e51b38e85 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -14054,7 +14054,7 @@ "other": { "name": "ncurses", "version": "6.4", - "downloadUrl": "https://invisible-mirror.net/archives/ncurses/current/ncurses-6.4-20230408.tgz" + "downloadUrl": "https://invisible-mirror.net/archives/ncurses/current/ncurses-6.4-20230423.tgz" } } }, diff --git a/toolkit/resources/manifests/package/pkggen_core_aarch64.txt b/toolkit/resources/manifests/package/pkggen_core_aarch64.txt index 4b4d7a1650..a93a72b35a 100644 --- a/toolkit/resources/manifests/package/pkggen_core_aarch64.txt +++ b/toolkit/resources/manifests/package/pkggen_core_aarch64.txt @@ -33,11 +33,11 @@ libpkgconf-1.8.0-3.cm2.aarch64.rpm pkgconf-1.8.0-3.cm2.aarch64.rpm pkgconf-m4-1.8.0-3.cm2.noarch.rpm pkgconf-pkg-config-1.8.0-3.cm2.aarch64.rpm -ncurses-6.4-1.cm2.aarch64.rpm -ncurses-compat-6.4-1.cm2.aarch64.rpm -ncurses-devel-6.4-1.cm2.aarch64.rpm -ncurses-libs-6.4-1.cm2.aarch64.rpm -ncurses-term-6.4-1.cm2.aarch64.rpm +ncurses-6.4-2.cm2.aarch64.rpm +ncurses-compat-6.4-2.cm2.aarch64.rpm +ncurses-devel-6.4-2.cm2.aarch64.rpm +ncurses-libs-6.4-2.cm2.aarch64.rpm +ncurses-term-6.4-2.cm2.aarch64.rpm readline-8.1-1.cm2.aarch64.rpm readline-devel-8.1-1.cm2.aarch64.rpm coreutils-8.32-7.cm2.aarch64.rpm diff --git a/toolkit/resources/manifests/package/pkggen_core_x86_64.txt b/toolkit/resources/manifests/package/pkggen_core_x86_64.txt index ca8d153ae9..96bec364e1 100644 --- a/toolkit/resources/manifests/package/pkggen_core_x86_64.txt +++ b/toolkit/resources/manifests/package/pkggen_core_x86_64.txt @@ -33,11 +33,11 @@ libpkgconf-1.8.0-3.cm2.x86_64.rpm pkgconf-1.8.0-3.cm2.x86_64.rpm pkgconf-m4-1.8.0-3.cm2.noarch.rpm pkgconf-pkg-config-1.8.0-3.cm2.x86_64.rpm -ncurses-6.4-1.cm2.x86_64.rpm -ncurses-compat-6.4-1.cm2.x86_64.rpm -ncurses-devel-6.4-1.cm2.x86_64.rpm -ncurses-libs-6.4-1.cm2.x86_64.rpm -ncurses-term-6.4-1.cm2.x86_64.rpm +ncurses-6.4-2.cm2.x86_64.rpm +ncurses-compat-6.4-2.cm2.x86_64.rpm +ncurses-devel-6.4-2.cm2.x86_64.rpm +ncurses-libs-6.4-2.cm2.x86_64.rpm +ncurses-term-6.4-2.cm2.x86_64.rpm readline-8.1-1.cm2.x86_64.rpm readline-devel-8.1-1.cm2.x86_64.rpm coreutils-8.32-7.cm2.x86_64.rpm diff --git a/toolkit/resources/manifests/package/toolchain_aarch64.txt b/toolkit/resources/manifests/package/toolchain_aarch64.txt index 0bd3e09f9e..fe0139a962 100644 --- a/toolkit/resources/manifests/package/toolchain_aarch64.txt +++ b/toolkit/resources/manifests/package/toolchain_aarch64.txt @@ -249,12 +249,12 @@ mpfr-4.1.0-2.cm2.aarch64.rpm mpfr-debuginfo-4.1.0-2.cm2.aarch64.rpm mpfr-devel-4.1.0-2.cm2.aarch64.rpm msopenjdk-11-11.0.18-1.aarch64.rpm -ncurses-6.4-1.cm2.aarch64.rpm -ncurses-compat-6.4-1.cm2.aarch64.rpm -ncurses-debuginfo-6.4-1.cm2.aarch64.rpm -ncurses-devel-6.4-1.cm2.aarch64.rpm -ncurses-libs-6.4-1.cm2.aarch64.rpm -ncurses-term-6.4-1.cm2.aarch64.rpm +ncurses-6.4-2.cm2.aarch64.rpm +ncurses-compat-6.4-2.cm2.aarch64.rpm +ncurses-debuginfo-6.4-2.cm2.aarch64.rpm +ncurses-devel-6.4-2.cm2.aarch64.rpm +ncurses-libs-6.4-2.cm2.aarch64.rpm +ncurses-term-6.4-2.cm2.aarch64.rpm newt-0.52.21-5.cm2.aarch64.rpm newt-debuginfo-0.52.21-5.cm2.aarch64.rpm newt-devel-0.52.21-5.cm2.aarch64.rpm diff --git a/toolkit/resources/manifests/package/toolchain_x86_64.txt b/toolkit/resources/manifests/package/toolchain_x86_64.txt index e168b9fb0f..cc1a803330 100644 --- a/toolkit/resources/manifests/package/toolchain_x86_64.txt +++ b/toolkit/resources/manifests/package/toolchain_x86_64.txt @@ -249,12 +249,12 @@ mpfr-4.1.0-2.cm2.x86_64.rpm mpfr-debuginfo-4.1.0-2.cm2.x86_64.rpm mpfr-devel-4.1.0-2.cm2.x86_64.rpm msopenjdk-11-11.0.18-1.x86_64.rpm -ncurses-6.4-1.cm2.x86_64.rpm -ncurses-compat-6.4-1.cm2.x86_64.rpm -ncurses-debuginfo-6.4-1.cm2.x86_64.rpm -ncurses-devel-6.4-1.cm2.x86_64.rpm -ncurses-libs-6.4-1.cm2.x86_64.rpm -ncurses-term-6.4-1.cm2.x86_64.rpm +ncurses-6.4-2.cm2.x86_64.rpm +ncurses-compat-6.4-2.cm2.x86_64.rpm +ncurses-debuginfo-6.4-2.cm2.x86_64.rpm +ncurses-devel-6.4-2.cm2.x86_64.rpm +ncurses-libs-6.4-2.cm2.x86_64.rpm +ncurses-term-6.4-2.cm2.x86_64.rpm newt-0.52.21-5.cm2.x86_64.rpm newt-debuginfo-0.52.21-5.cm2.x86_64.rpm newt-devel-0.52.21-5.cm2.x86_64.rpm