Bug 365869 - [Libarchive] Data-loss when aborting an AddJob
Summary: [Libarchive] Data-loss when aborting an AddJob
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: plugins (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR critical
Target Milestone: ---
Assignee: Ragnar Thomsen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-19 16:26 UTC by Elvis Angelaccio
Modified: 2016-10-23 09:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 16.08.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elvis Angelaccio 2016-07-19 16:26:06 UTC
See steps

Reproducible: Always

Steps to Reproduce:
1. Open a huge tar-based archive
2. Add some file to it
3. Close Ark

Actual Results:  
The original archive is gone, the resulting file is only a fraction of what it was before.

Expected Results:  
The archive should not be modified at all, since we aborted the job.

CLI-based plugins don't seem to suffer this issue.
Comment 1 Elvis Angelaccio 2016-10-23 09:30:50 UTC
Git commit d1444e74574dd4c57455ab0dd554da105ac37498 by Elvis Angelaccio.
Committed on 23/10/2016 at 09:26.
Pushed by elvisangelaccio into branch 'Applications/16.08'.

libarchive: fix data loss when aborting AddJobs and Deletejobs

Currently there is data loss when we abort an AddJob or DeleteJob with the
libarchive plugin. This happens because we always call `commit()` on the QSaveFile.

With this patch we call `commit()` only when we are not aborting (killing) the job.
FIXED-IN: 16.08.3

Differential Revision: D3129

M  +12   -5    plugins/libarchive/readwritelibarchiveplugin.cpp

http://commits.kde.org/ark/d1444e74574dd4c57455ab0dd554da105ac37498