libarchive: Improve error-handling when loading archive
ClosedPublic

Authored by rthomsen on May 3 2020, 2:01 PM.

Details

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, 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, and verify that the corrupt archive warning is shown.

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rthomsen created this revision.May 3 2020, 2:01 PM
Restricted Application added subscribers: Ark, kde-utils-devel. · View Herald TranscriptMay 3 2020, 2:01 PM
rthomsen requested review of this revision.May 3 2020, 2:01 PM
elvisangelaccio accepted this revision.May 3 2020, 5:14 PM
This revision is now accepted and ready to land.May 3 2020, 5:14 PM
This revision was automatically updated to reflect the committed changes.