Bug 176646 - Enable extracting of zip files with (technically invalid) windows style pathnames
Summary: Enable extracting of zip files with (technically invalid) windows style pathn...
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mandriva RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
: 145426 190515 253392 346276 400435 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-01 20:18 UTC by Tony White
Modified: 2021-04-05 13:36 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 21.08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony White 2008-12-01 20:18:11 UTC
Version:            (using KDE 4.1.3)
OS:                Linux
Installed from:    Mandriva RPMs

Here's the archive :

http://mirror05.x264.nl/Sharktooth/force.php?file=./MeGUI/profiles/MeGUI-x264_generic_profiles_v82.zip

It's x264 profiles I want to use.

Ark
Version 2.11.999
Using KDE 4.1.3 (KDE 4.1.3)

Problem :

Right click > Extract here, In konqueror produces nothing.

Left clicking on the archive in konqueror produces :
Could not open file, probably due to an unsupported file format.

Right clicking on the archive then open with ark opens the archive and the containing files are displayed.
Extracting the files, Ark just makes the processor race and gives no indication that there is a problem.

What should happen :

Ark should be able to extract the archive or at least provide a message that it is incapable doing so.

What's going wrong :

I was able to extract the archive using the console and p7zip using :

7z e MeGUI-x264_generic_profiles_v82.zip

The :

skipping: allprofiles\x264\x264_dp_ Device-Archos605.xml  need PK compat. v4.5 (can do v2.1)

message for every file when trying :

unzip MeGUI-x264_generic_profiles_v82.zip

was what exposed the issue.

It would be nice if ark was able to use 7z e instead of unzip if p7zip is installed and the archive fails in this way using unzip, In future please.

I don't think it's my place to suggest to one of the open source x264 developers that he uses an obscure zip format and should use bz2 or a 7z container to archive and distribute his files.

So the ability to uncompress 7z compressed zip archives from a zip container if pzip is present in ark to fix this please.

I think an error message is an easy out instead of adding the functionality but I can see why this might be a bit tricky to fix because I also guess that the only way to distinguish between different compression formats in a zip container is when they fail to extract.
Unless there is another way?
Comment 1 Harald Hvaal 2008-12-01 23:49:31 UTC
Hello and thanks for the bug report. I tried to open the zip file, and the problem was immediately visible; this is a zip file that uses the "\" character for splitting folders. This is actually not allowed according to the zip file specification, so I am tempted to just say that this is an invalid zip file.

I would, however, like to know how widespread this kind of zip files is. Obviously, there is some windows client that actually makes these faulty zip files. Could you tell me where to contact the person that made that zip file?

If this kind of zip files actually is a common one, it might make sense to support them (although I'm not entirely sure how to do it...).
Comment 2 Tony White 2008-12-03 17:29:24 UTC
Hi Harald, Yeah sure, I have a bit more info to add about this which might be useful.

http://mirror05.x264.nl/Sharktooth/?dir=./MeGUI/profiles
Is where they are stored.
The developer's handle is Sharktooth and I don't think he has any visable blog or anything.

The link comes from here :

http://forum.doom9.org/showthread.php?t=101813

and I can't be sure how Sharktooth is involved in x264.
I do know that he used the program MeGUI :

http://mewiki.project357.com/wiki/MeGUI:Main_Page

To create the archive because MeGUI has the capability to export the profiles it is used to create, Into zip archives.
It's windows only too, I'm afraid.
I think that the program uses a 7zip dll to export the zip files.

So I guess that this problem isn't common and widespread but possible if there are libraries out there creating zip archives that don't correctly follow the specification.
I think the main thing here, Whether or not you can work around this, Is having a way of preventing ark from erroring out without response and also notifying the user that they have a "Not to spec" archive on their hands.
Not displaying the contents of the file would be an idea too, If ark can't extract them and you decide to go the "Archive not supported" route.

Is there any reason why pzip can't be used to extract all zip archives instead of unzip if it is found on the system?
Comment 3 Harald Hvaal 2008-12-04 03:30:38 UTC
Well actually, libzip - another library - is used, not unzip. The fact that both unzip and ark failed on this file is just because they both have no support for invalid files.

And using 7zip as an escape route would be a very ugly solution, I would rather just fix the libzip plugin.

Fixing this problem for ark is actually a quite simple thing to do - it's just a question of whether it's a good thing to do. Per the specification, '\' is just a normal character, and '/' is the folder separator. If I also accept the '\' as a folder separator, then it would work for these kind of invalid windows zip archives, but on the other hand it would break on (probably rare, but) valid archives that uses '\' as part of the filename. It's a tradeoff I'm not sure what to do with right now.
Comment 4 Harald Hvaal 2009-01-10 10:21:25 UTC
*** Bug 145426 has been marked as a duplicate of this bug. ***
Comment 5 Juha Manninen 2009-01-24 20:04:14 UTC
At least IZArc is making those packages with backslash path separator.
Comment 6 Raphael Kubo da Costa 2009-04-25 16:14:31 UTC
*** Bug 190515 has been marked as a duplicate of this bug. ***
Comment 7 Raphael Kubo da Costa 2010-10-14 15:52:42 UTC
*** Bug 253392 has been marked as a duplicate of this bug. ***
Comment 8 Raphael Kubo da Costa 2010-12-08 02:18:41 UTC
Changing the default assignee in the currently open Ark bug reports to me.
Comment 9 Elvis Angelaccio 2015-10-27 12:02:53 UTC
*** Bug 346276 has been marked as a duplicate of this bug. ***
Comment 10 Elvis Angelaccio 2015-12-28 22:20:07 UTC
Marking as fixed, as Ark 15.12 uses by default the 7z plugin for zip archives.
p7zip has limited support for windows-style pathnames: it won't preverse the directories structure, but it will allow you to extract and recover all the files in the zip.

There is not really much more that we can do. After all, specifications exist for a reason and we are talking about invalid zip archives here.
Comment 11 Elvis Angelaccio 2018-11-02 12:05:40 UTC
Re-opening.

Apparently info-zip is now able to correctly extract these kind of archives. No idea how.

What we could do from the ark side is to re-load the archive forcing the info-zip plugin, if we detect the archive is using windows-style pathnames.
Comment 12 Elvis Angelaccio 2018-11-02 12:06:23 UTC
*** Bug 400435 has been marked as a duplicate of this bug. ***
Comment 13 Elvis Angelaccio 2021-04-05 08:32:12 UTC
Support for this has been added to the libzip plugin: https://invent.kde.org/utilities/ark/-/merge_requests/28

Marking as fixed since it's the default plugin for zip files nowadays.