From 2957f63ae94a44084424568cd15a621ddbc715ae Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 22 Nov 2023 13:52:29 +0100 Subject: [PATCH] C compatibility fixes The tigervnc-xserver120.patch change is already upstream (commit e4ec992984983ac9107efae1f1cc552007e4229e). Related to: --- tigervnc-c99-1.patch | 30 ++++++++++++++++++++++++++++++ tigervnc-c99-2.patch | 23 +++++++++++++++++++++++ tigervnc-xserver120.patch | 2 +- tigervnc.spec | 11 ++++++++++- 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 tigervnc-c99-1.patch create mode 100644 tigervnc-c99-2.patch diff --git a/tigervnc-c99-1.patch b/tigervnc-c99-1.patch new file mode 100644 index 0000000..6b3a84e --- /dev/null +++ b/tigervnc-c99-1.patch @@ -0,0 +1,30 @@ +Replace INITARGS with void + +Most compilers currently accept arbitrary identifiers in this place +and ignore then, but this is going to change and turn into an error. + +Submitted upstream: + + +diff --git a/unix/xserver/hw/vnc/vncModule.c b/unix/xserver/hw/vnc/vncModule.c +index a448c2f1..fb8ce047 100644 +--- a/unix/xserver/hw/vnc/vncModule.c ++++ b/unix/xserver/hw/vnc/vncModule.c +@@ -36,7 +36,7 @@ + #include "XorgGlue.h" + #include "RandrGlue.h" + +-static void vncModuleInit(INITARGS); ++static void vncModuleInit(void); + + static MODULESETUPPROTO(vncSetup); + +@@ -70,7 +70,7 @@ vncSetup(void * module, void * opts, int *errmaj, int *errmin) { + return (void *)1; + } + +-static void vncModuleInit(INITARGS) ++static void vncModuleInit(void) + { + static char once = 0; + diff --git a/tigervnc-c99-2.patch b/tigervnc-c99-2.patch new file mode 100644 index 0000000..763bb1c --- /dev/null +++ b/tigervnc-c99-2.patch @@ -0,0 +1,23 @@ +commit 25a03f430f47733b215eb9f0251e25ce7bdb7ada +Author: Florian Weimer +Date: Wed Nov 22 12:57:03 2023 +0100 + + cmake: Use correct input pointer type for iconv detection + + The iconv function expects a char ** pointer argument for the input + pointer. Future C compilers will flag this as an error (as it is not + valid C), causing this probe to fail incorrectly. + +diff --git a/cmake/Modules/FindIconv.cmake b/cmake/Modules/FindIconv.cmake +index cf268ea0..9cd899da 100644 +--- a/cmake/Modules/FindIconv.cmake ++++ b/cmake/Modules/FindIconv.cmake +@@ -36,7 +36,7 @@ IF(ICONV_FOUND) + #include + int main(){ + iconv_t conv = 0; +- const char* in = 0; ++ char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; diff --git a/tigervnc-xserver120.patch b/tigervnc-xserver120.patch index e7eae3c..abccc9a 100644 --- a/tigervnc-xserver120.patch +++ b/tigervnc-xserver120.patch @@ -67,7 +67,7 @@ index 5596e21..003fc3c 100644 #include "globals.h" +#ifdef TIGERVNC -+extern void vncExtensionInit(INITARGS); ++extern void vncExtensionInit(void); +#endif + /* List of built-in (statically linked) extensions */ diff --git a/tigervnc.spec b/tigervnc.spec index 7c6b354..d70551f 100644 --- a/tigervnc.spec +++ b/tigervnc.spec @@ -6,7 +6,7 @@ Name: tigervnc Version: 1.13.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A TigerVNC remote display system %global _hardened_build 1 @@ -31,6 +31,9 @@ Patch1: tigervnc-vncsession-restore-script-systemd-service.patch # This is tigervnc-%%{version}/unix/xserver116.patch rebased on the latest xorg Patch100: tigervnc-xserver120.patch +Patch101: tigervnc-c99-1.patch +Patch102: tigervnc-c99-2.patch + BuildRequires: make BuildRequires: gcc-c++ BuildRequires: gettext @@ -196,6 +199,9 @@ sed -i -e '/add_subdirectory.*vnc/d' unix/CMakeLists.txt # Downstream patches +%patch101 -p1 -b .c99-1 +%patch102 -p1 -b .c99-2 + %build %ifarch sparcv9 sparc64 s390 s390x export CFLAGS="$RPM_OPT_FLAGS -fPIC" @@ -379,6 +385,9 @@ fi %{_datadir}/icons/hicolor/*/apps/* %changelog +* Wed Nov 22 2023 Florian Weimer - 1.13.1-7 +- C compatibility fixes + * Thu Nov 02 2023 Jan Grulich - 1.13.1-6 - Fix CVE-2023-5380 and CVE-2023-5367 (rebuild with fixed Xorg)