Bug 261073 - Ark does not report that the archive is corrupted.
Summary: Ark does not report that the archive is corrupted.
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: 2.15
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Ragnar Thomsen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-23 15:28 UTC by dmitryunruh
Modified: 2015-10-14 16:50 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 15.12.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dmitryunruh 2010-12-23 15:28:49 UTC
Version:           2.15 (using KDE 4.5.1) 
OS:                Linux

I downloaded the *.zip file from the Internet. When it opens, Ark shows that the file is empty. WinRAR in Windows reports that the archive is corrupted. Why Ark does not?

Reproducible: Always




OS: Linux (i686) release 2.6.35-24-generic
Compiler: cc
Comment 1 Nicolas L. 2011-01-03 17:27:39 UTC
Is there somewhere we can dl this archive ?
Comment 2 Raphael Kubo da Costa 2011-01-03 17:36:02 UTC
I think you can reproduce it in one of these two ways:

 * Create a random zip or rar file and then run truncate on it -- unrar will report 'unexpected end of archive' and unzip will probably say something similar.

 * Create an archive and use an hex editor to edit random bits in it.
Comment 3 dmitryunruh 2011-01-04 14:18:42 UTC
When I created an bug report, I attached a damaged archive. Now here I do not see it. And you? Maybe I should try to make it again? Or something I do not understand?
Comment 4 Raphael Kubo da Costa 2011-01-04 14:26:08 UTC
Hi,

There's no file attached to this bug report. You can either try to attach it again, or follow the instructions in comment #2 -- if those cause the same problem, then we all have a way to reproduce it.
Comment 5 dmitryunruh 2011-01-04 15:10:03 UTC
Another way - the link for this file: http://tinyurl.com/mcwd6d
It's equivalent to http://djdoboy.com/mixes/ --> klassic mix 02.
Comment 6 Raphael Kubo da Costa 2011-01-04 15:15:46 UTC
Thanks.

Indeed, just creating an archive and running 'truncate' on it does the trick too.

Ark must implement an interface for each plugin to indentify 'corrupted archive' messages and report it back to Kerfuffle.
Comment 7 ariasuni 2015-10-03 23:30:27 UTC
I still have the problem with latest KDE Plasma (5.4.1)/Applications (15.08.1)/Frameworks stack (5.14.0).
Comment 8 Ragnar Thomsen 2015-10-04 10:30:33 UTC
Ark will be have better handling of corrupt archives in the 15.12 release in December.
Comment 9 Ragnar Thomsen 2015-10-04 14:03:21 UTC
Git commit 170115f17e2be3e1703efe5cec6fea8e762ddd67 by Ragnar Thomsen.
Committed on 04/10/2015 at 13:59.
Pushed by rthomsen into branch 'master'.

Improve handling of corrupt archives by CliPlugins

A new parameter was added to the Kerfuffle::CliInterfaceParameters enum
(called CorruptArchivePatterns), containing a list of regexps matching
output from CliPlugins when a corrupt archive is listed.

Due to the CliInterface not being able to launch a KMessageBox itself, a
query (LoadCorruptQuery) was added which launches a
KMessageBox::warningYesNo asking the user if he wants to try to load the
corrupt archive. This is useful because some files might still be
recoverable.

If the user answers no, loading of the archive is cancelled.

If the user answers yes the archive is loaded as usual, but to prevent
the user from trying to add/delete files from the corrupt archive (which
is likely to fail), the archive is set to readonly. This necessitated a
new private member in ReadOnlyArchiveInterface (m_isCorrupt) and
getter/setter functions. The setter function is used in
CliInterface::HandleLine, while the getter function is used in
ReadWriteArchiveInterface::isReadOnly().
Related: bug 352949
FIXED-IN: 15.12.0
REVIEW: 125363

M  +17   -3    kerfuffle/archiveinterface.cpp
M  +3    -0    kerfuffle/archiveinterface.h
M  +13   -0    kerfuffle/cliinterface.cpp
M  +5    -0    kerfuffle/cliinterface.h
M  +24   -0    kerfuffle/queries.cpp
M  +21   -0    kerfuffle/queries.h
M  +2    -0    plugins/cli7zplugin/cliplugin.cpp
M  +2    -0    plugins/clirarplugin/cliplugin.cpp
M  +1    -0    plugins/clizipplugin/cliplugin.cpp

http://commits.kde.org/ark/170115f17e2be3e1703efe5cec6fea8e762ddd67
Comment 10 ariasuni 2015-10-04 20:14:03 UTC
Nice, thank you very much. :)