From: "Yixun Lan" <dlan@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/torrentzip/files/, app-arch/torrentzip/
Date: Sat, 16 Mar 2024 00:31:04 +0000 (UTC) [thread overview]
Message-ID: <1710549054.c1ec2a01707d90ca867310347ec12a14679043e5.dlan@gentoo> (raw)
commit: c1ec2a01707d90ca867310347ec12a14679043e5
Author: Alexander Miller <alex.miller <AT> gmx <DOT> de>
AuthorDate: Tue Mar 5 20:24:41 2024 +0000
Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Sat Mar 16 00:30:54 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1ec2a01
app-arch/torrentzip: Fix 1.2 regression
TorrentZip 1.2 skips files although their checksum comment
doesn't match or is entirely missing, which is a serious
problem.
Pick the patch from upstream git main that fixes the issue.
See: https://github.com/0-wiz-0/trrntzip/pull/3#issuecomment-1975326415
Closes: https://github.com/gentoo/gentoo/pull/35634
Signed-off-by: Alexander Miller <alex.miller <AT> gmx.de>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
.../files/torrentzip-1.2-checksum-detection.patch | 51 ++++++++++++++++++++++
...rentzip-1.2.ebuild => torrentzip-1.2-r1.ebuild} | 3 ++
2 files changed, 54 insertions(+)
diff --git a/app-arch/torrentzip/files/torrentzip-1.2-checksum-detection.patch b/app-arch/torrentzip/files/torrentzip-1.2-checksum-detection.patch
new file mode 100644
index 000000000000..ac1ae14cbe03
--- /dev/null
+++ b/app-arch/torrentzip/files/torrentzip-1.2-checksum-detection.patch
@@ -0,0 +1,51 @@
+From 016915e16f32105590a6dc11a4adc988b2f8d9a9 Mon Sep 17 00:00:00 2001
+From: Alexander Miller <alex.miller@gmx.de>
+Date: Mon, 4 Mar 2024 19:26:21 +0100
+Subject: [PATCH] Fix broken detection of missing or wrong TORRENTZIPPED-...
+ comment
+
+The commit listed below introduces a regression where in MigrateZip(),
+variable rc would be clobbered when its value is still needed. That
+completely breaks handling of zips that should be re-zipped because
+of missing or out of date TORRENTZIPPED-... comment.
+
+Rewrite the offending code such that it no longer touches the variable.
+
+Fixes: cf11c900079e ("Check for more errors while reading zip entries")
+---
+ src/trrntzip.c | 20 ++++++++++++--------
+ 1 file changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/src/trrntzip.c b/src/trrntzip.c
+index e55d217..49f796e 100644
+--- a/src/trrntzip.c
++++ b/src/trrntzip.c
+@@ -379,16 +379,20 @@ int MigrateZip(const char *zip_path, const char *pDir, WORKSPACE *ws,
+
+ CHECK_DYNAMIC_STRING_ARRAY(ws->FileNameArray, ws->iElements);
+ // Get the filelist from the zip file in original order in ws->FileNameArray
+- rc = GetFileList(UnZipHandle, ws);
+- if (rc != TZ_OK) {
++ switch (GetFileList(UnZipHandle, ws)) {
++ case TZ_OK:
++ break;
++ case TZ_CRITICAL:
+ logprint3(stderr, mig->fProcessLog, ErrorLog(ws),
+- rc == TZ_CRITICAL
+- ? "Error allocating memory!\n"
+- : "Could not list contents of \"%s\". File is corrupted or "
+- "contains entries with bad names.\n",
+- szZipFileName);
++ "Error allocating memory!\n");
++ unzClose(UnZipHandle);
++ return TZ_CRITICAL;
++ default:
++ logprint3(stderr, mig->fProcessLog, ErrorLog(ws),
++ "Could not list contents of \"%s\". File is corrupted or "
++ "contains entries with bad names.\n", szZipFileName);
+ unzClose(UnZipHandle);
+- return rc;
++ return TZ_ERR;
+ }
+ CHECK_DYNAMIC_STRING_ARRAY(ws->FileNameArray, ws->iElements);
+
diff --git a/app-arch/torrentzip/torrentzip-1.2.ebuild b/app-arch/torrentzip/torrentzip-1.2-r1.ebuild
similarity index 90%
rename from app-arch/torrentzip/torrentzip-1.2.ebuild
rename to app-arch/torrentzip/torrentzip-1.2-r1.ebuild
index beb03c69a832..7dfb7fbdde2b 100644
--- a/app-arch/torrentzip/torrentzip-1.2.ebuild
+++ b/app-arch/torrentzip/torrentzip-1.2-r1.ebuild
@@ -23,3 +23,6 @@ DEPEND="
"
DOCS=(AUTHORS NEWS.md README.md)
+PATCHES=(
+ "${FILESDIR}-${P}-checksum-detection.patch"
+)
next reply other threads:[~2024-03-16 0:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-16 0:31 Yixun Lan [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-02 7:00 [gentoo-commits] repo/gentoo:master commit in: app-arch/torrentzip/files/, app-arch/torrentzip/ Joonas Niilola
2020-11-19 10:22 Joonas Niilola
2016-07-03 11:57 Patrice Clement
2016-03-22 11:00 Patrice Clement
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1710549054.c1ec2a01707d90ca867310347ec12a14679043e5.dlan@gentoo \
--to=dlan@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox