Bug 365869

Summary: [Libarchive] Data-loss when aborting an AddJob
Product: [Applications] ark Reporter: Elvis Angelaccio <elvis.angelaccio>
Component: pluginsAssignee: Ragnar Thomsen <rthomsen6>
Status: RESOLVED FIXED    
Severity: critical CC: elvis.angelaccio
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 16.08.3
Sentry Crash Report:

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