D29383: libarchive: Improve error-handling when loading archive

Ragnar Thomsen noreply at phabricator.kde.org
Sun May 3 15:01:30 BST 2020


rthomsen created this revision.
rthomsen added a reviewer: elvisangelaccio.
rthomsen added a project: Ark.
Herald added subscribers: Ark, kde-utils-devel.
rthomsen requested review of this revision.

REVISION SUMMARY
  This diff improves error-handling in `LibarchivePlugin::list()`. Previously we only checked whether we could read until the end of the archive, and even if we couldn't there was no error shown to the user. The diff checks the return value of both `archive_read_next_header()` and `archive_read_data_skip()`, and shows a corrupt archive query if either was not successful.
  
  This partially solves bug 411074 <https://bugs.kde.org/show_bug.cgi?id=411074>, as Ark now at least gives a warning when opening the archive. We still need to improve error-handling when extracting, but the code in `LibarchivePlugin::extractFiles()` is such a mess currently so it's a larger task.

TEST PLAN
  Open a corrupt archive using the libarchive plugin, e.g. the attached archive in bug 411074 <https://bugs.kde.org/show_bug.cgi?id=411074>, and verify that the corrupt archive warning is shown.

REPOSITORY
  R36 Ark

REVISION DETAIL
  https://phabricator.kde.org/D29383

AFFECTED FILES
  plugins/libarchive/libarchiveplugin.cpp
  plugins/libarchive/libarchiveplugin.h

To: rthomsen, elvisangelaccio
Cc: kde-utils-devel, #ark, fbampaloukas, tctara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20200503/5fb5eae0/attachment.html>


More information about the Kde-utils-devel mailing list