Bug 384622

Summary: No warning or notification for files with errors that fail integrity test
Product: [Applications] ark Reporter: Fahad Alduraibi <fadnix>
Component: generalAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, rthomsen6, simonandric5
Priority: NOR    
Version: 16.12.3   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 17.12.0
Sentry Crash Report:
Attachments: Test zip file (intentionally corrupted file)

Description Fahad Alduraibi 2017-09-12 14:04:22 UTC
Created attachment 107814 [details]
Test zip file (intentionally corrupted file)

Opening and extracting files from a zip file that is partially corrupt using Ark will not show warning or notification that the file is corrupt and doesn't pass the integrity test.

This is a very annoying problem since without seeing an error message people will assume everything is fine, until they start using these files. Sometimes you will have partially extracted files, other times you will have all the files but some with wrong content.

Seeing an error message will save a lot of troubleshooting hours of e.g. why the extracted application doesn't work like it did on the other machine.
Comment 1 Elvis Angelaccio 2017-09-12 21:21:21 UTC
Sounds reasonable. The problem is that running the integrity check would increase the latency before you can actually do something with the archive, in particular with big archives + HDD drives. Ideally we should perform the integrity test in the background, without blocking the UI.
Comment 2 Ragnar Thomsen 2017-10-21 16:13:53 UTC
Git commit 48393a65b7304aec077e08af0f98ed3257eb2d6d by Ragnar Thomsen.
Committed on 21/10/2017 at 16:11.
Pushed by rthomsen into branch 'master'.

Detect CRC errors when extracting w. cli7z and clizip
Detect CRC errors when extracting with the two plugins and produce
appropriate error messages.
FIXED-IN: 17.12.0
Differential Revision: D8392

A  +-    --    autotests/kerfuffle/data/testdirwithemptysubdir_1.rar
M  +9    -3    plugins/cli7zplugin/cliplugin.cpp
M  +7    -1    plugins/clizipplugin/cliplugin.cpp

https://commits.kde.org/ark/48393a65b7304aec077e08af0f98ed3257eb2d6d
Comment 3 Ragnar Thomsen 2017-10-21 17:34:12 UTC
Git commit a9147d82b3d14daf3885447987dfe9e61815ede8 by Ragnar Thomsen.
Committed on 21/10/2017 at 17:32.
Pushed by rthomsen into branch 'master'.

libzip: Improve test integrity function

The old test implementation only opens the archive with some additional
checks, but fails to detect archives with CRC errors for entries.

We now read each entry and check the CRC checksum against the one given
in the file header. We use zlib's crc32() function to compute the
checksum.
Differential Revision: D8400

M  +7    -1    plugins/libzipplugin/CMakeLists.txt
M  +28   -0    plugins/libzipplugin/libzipplugin.cpp

https://commits.kde.org/ark/a9147d82b3d14daf3885447987dfe9e61815ede8