From f3665784e5832c0d14f5f934a957e172e6fe09d1 Mon Sep 17 00:00:00 2001 From: zhangxingrong Date: Mon, 8 Jul 2024 09:51:46 +0800 Subject: [PATCH] add some upstream patchs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update zziplib.spec. 补充打patch遗漏的内容 Signed-off-by: zhangxingrong update zziplib.spec. Signed-off-by: zhangxingrong --- ...rt-Fix-invalid-file-descriptor-close.patch | 30 +++++++++++++++++++ ...seeko.h-Fix-closing-extern-C-bracket.patch | 25 ++++++++++++++++ zziplib.spec | 10 ++++++- 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 backport-Fix-invalid-file-descriptor-close.patch create mode 100644 backport-zzip-fseeko.h-Fix-closing-extern-C-bracket.patch diff --git a/backport-Fix-invalid-file-descriptor-close.patch b/backport-Fix-invalid-file-descriptor-close.patch new file mode 100644 index 0000000..a2449c3 --- /dev/null +++ b/backport-Fix-invalid-file-descriptor-close.patch @@ -0,0 +1,30 @@ +From 2b0adb9111a080c0d4f71324a1511f64e7fee0af Mon Sep 17 00:00:00 2001 +From: Bruno de Lacheisserie +Date: Tue, 25 Apr 2023 23:57:18 +0200 +Subject: [PATCH] Fix invalid file descriptor close + + closed by `zzip_dir_fdopen_ext_io` and it's caller in case of error. +--- + zzip/zip.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/zzip/zip.c b/zzip/zip.c +index dfa1c2f..5b7a262 100644 +--- a/zzip/zip.c ++++ b/zzip/zip.c +@@ -738,8 +738,14 @@ zzip_dir_fdopen_ext_io(int fd, zzip_error_t * errcode_p, + *errcode_p = rv; + return dir; + error: +- if (dir) ++ if (dir) { ++ /* ++ * in case of error, fd will be closed by caller, ++ * don't take the fd ownership, otherwise fd will be closed twice ++ */ ++ dir->fd = -1; + zzip_dir_free(dir); ++ } + if (errcode_p) + *errcode_p = rv; + return NULL; diff --git a/backport-zzip-fseeko.h-Fix-closing-extern-C-bracket.patch b/backport-zzip-fseeko.h-Fix-closing-extern-C-bracket.patch new file mode 100644 index 0000000..1fbc6c3 --- /dev/null +++ b/backport-zzip-fseeko.h-Fix-closing-extern-C-bracket.patch @@ -0,0 +1,25 @@ +From 3d28fca14c0e230669dfa5ad97b95a6e2829680f Mon Sep 17 00:00:00 2001 +From: Benjamin Drung +Date: Wed, 31 May 2023 13:49:28 +0200 +Subject: [PATCH] zzip/fseeko.h: Fix closing extern C bracket + +Line 24 in `zzip/fseeko.h` opens the `extern "C"` bracket. This bracket +needs to be closed at the end of the file. + +Signed-off-by: Benjamin Drung +--- + zzip/fseeko.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/zzip/fseeko.h b/zzip/fseeko.h +index 96faa011..859e89ff 100644 +--- a/zzip/fseeko.h ++++ b/zzip/fseeko.h +@@ -147,7 +147,6 @@ struct zzip_entry /* : struct zzip_disk_entry */ + #endif + + #ifdef __cplusplus +-extern "C" { + } + #endif + #endif diff --git a/zziplib.spec b/zziplib.spec index 38dda8e..9069995 100644 --- a/zziplib.spec +++ b/zziplib.spec @@ -4,7 +4,7 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool Name: zziplib Version: 0.13.71 -Release: 7 +Release: 8 Summary: Lightweight library for zip compression License: LGPLv2+ or MPLv1.1 URL: http://zziplib.sourceforge.net @@ -19,6 +19,8 @@ Patch6005: backport-0006-CVE-2020-18442.patch Patch6006: backport-0007-CVE-2020-18442.patch Patch6007: zziplib-0.13.71-sw.patch Patch6008: backport-CVE-2020-18770.patch +Patch6009: backport-Fix-invalid-file-descriptor-close.patch +Patch6010: backport-zzip-fseeko.h-Fix-closing-extern-C-bracket.patch BuildRequires: perl-interpreter zip xmlto BuildRequires: zlib-devel SDL-devel pkgconfig autoconf automake gcc make @@ -62,6 +64,8 @@ sed -i -e 's:docs ::g' Makefile.am %patch6006 -p1 %patch6007 -p1 %patch6008 -p1 +%patch6009 -p1 +%patch6010 -p1 %build %configure --disable-static --enable-sdl --enable-frame-pointer --enable-builddir=_builddir @@ -95,6 +99,10 @@ find %{buildroot} -type f -name "*.la" -delete -print %{_mandir}/man3/* %changelog +* Mon Jul 8 2024 zhangxingrong - 0.13.71-8 +- Fix invalid file descriptor close +- zzip/fseeko.h: Fix closing extern C bracket + * Wed May 08 2024 liweigang - 0.13.71-7 - sync upstream patch for modify patch6008 -- Gitee