Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 946122

Summary: app-arch/p7zip-17.05-r1: lots of (old) zip archives can't be unzipped by this version
Product: Gentoo Linux Reporter: Vadim <lvd.mhm>
Component: Current packagesAssignee: Matthew Thode ( prometheanfire ) <prometheanfire>
Status: RESOLVED FIXED    
Severity: normal CC: asturm, gen2dev, lvd.mhm, prometheanfire
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/p7zip-project/p7zip/issues/112
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 933740    
Attachments: failing zip archive

Description Vadim 2024-12-08 16:36:52 UTC
After moving from 16.02 to 17.05, lots of old zip archives can't be more unzipped by 7z. It tries to create directory named as a file from archive, and then fails.

https://asciinema.org/a/aO7JjUDtnc9Lg7ozN8GNhMY00


Emerge info: https://pastebin.com/aF4LU3nc


zip file that causes 7z to fail is attached. It is taken from free modarchive.org release.

Other failing files from there:
ds_g_o_l.xm.zip
ds_i_k_a.xm.zip
godrest.it.zip
kirsikka.xm.zip
kmdream.it.zip
sflogic.it.zip
wc_confu.xm.zip

There are also thousands of failing zip archives from MAME torrent release.
Comment 1 Vadim 2024-12-08 16:47:20 UTC
Created attachment 913589 [details]
failing zip archive
Comment 2 Mike Gilbert gentoo-dev 2024-12-08 22:46:02 UTC
I would suggest trying app-arch/7zip instead.
Comment 3 Vadim 2024-12-10 10:36:50 UTC
Well, this is about workarounds, and it would include (for me) fixing and rewriting lots of scripts. Currently I've just downgraded to 16.02
Comment 4 gen2dev 2024-12-14 05:12:48 UTC
This is a bug in string localization causing a string buffer overrun that was reported upstream in 2021.
Upstream committed a fix for this and some related issues in May 2024.
    https://github.com/p7zip-project/p7zip/issues/112
    https://github.com/p7zip-project/p7zip/pull/233/commits/afec5e119df1f0706df619b6151b709945de4f43

That commit applies cleanly to p7zip-17.05_r1 and with it the bad file in this bug extracts as it should.
Comment 5 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2024-12-14 23:50:28 UTC
It seems to conflict with the natspec patch.

I wonder if it'd be better to go that way and force that usage instead.
Comment 6 gen2dev 2024-12-15 09:28:44 UTC
Maybe apply the upstream fix by default and make the natspec USE flag add the libnatspec dependency and apply the natspec patch instead of upstream. Then it'll work by default without whatever natspec requires and natspec users will still get what they asked for.

Or honestly, as already suggested, using 7zip instead and letting p7zip slip into history might be a better idea.

Thanks for your help, Matthew.
Comment 7 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2024-12-15 16:24:54 UTC
ya, that's fair, it's half abandonware upstream so maybe it's time to lastrites
Comment 8 Larry the Git Cow gentoo-dev 2024-12-24 15:44:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a71e1e4a0907b3172edb767c0eac01fe508e5ef1

commit a71e1e4a0907b3172edb767c0eac01fe508e5ef1
Author:     Matthew Thode <prometheanfire@gentoo.org>
AuthorDate: 2024-12-24 15:44:15 +0000
Commit:     Matthew Thode <prometheanfire@gentoo.org>
CommitDate: 2024-12-24 15:44:15 +0000

    app-arch/p7zip: localization patch backport
    
    Closes: https://bugs.gentoo.org/946122
    
    Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>

 .../p7zip/files/p7zip-17.05-localization.patch     | 234 +++++++++++++++++++++
 app-arch/p7zip/p7zip-17.05-r2.ebuild               | 114 ++++++++++
 2 files changed, 348 insertions(+)
Comment 9 Andreas Sturmlechner gentoo-dev 2025-01-20 16:55:36 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #7)
> ya, that's fair, it's half abandonware upstream so maybe it's time to
> lastrites
So, what now?
Comment 10 Andreas Sturmlechner gentoo-dev 2025-01-20 17:00:15 UTC
Your change introduced a new warning:

> $ pkgcheck scan
> [...]
>   WhitespaceFound: version 17.05-r2: ebuild has leading whitespace on lines: 36, 37