Start extraction only if Ark has proper permissions
ClosedPublic

Authored by elvisangelaccio on Nov 18 2015, 5:11 PM.

Details

Summary

We never check if a destination directory is writable, while doing an ExtractJob.
We can do this check only once, in ExtractJob::doWork(), instead of doing it
in each plugin's copyFiles(). This way we don't even start a cli process which
we already know is going to fail.

The only downside is that in batch mode (ark -b) the error message is displayed
twice, once in a KMessageBox and once in a Plasma notification.

BUG: 192219
FIXED-IN: 15.12.0

Test Plan

Trying to extract any kind of archive in a non-writable directory triggers the
error messagebox.

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.
elvisangelaccio retitled this revision from to Start extraction only if Ark has write permissions.
elvisangelaccio edited the test plan for this revision. (Show Details)
elvisangelaccio added a reviewer: rthomsen.
elvisangelaccio updated this object.
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptNov 18 2015, 5:11 PM
elvisangelaccio removed R36 Ark as the repository for this revision.

Update the diff (with an old-style patch, since apparently arcanist defaults to create diffs with respect to master)

rthomsen accepted this revision.Nov 18 2015, 6:58 PM
rthomsen edited edge metadata.
This revision is now accepted and ready to land.Nov 18 2015, 6:58 PM
elvisangelaccio retitled this revision from Start extraction only if Ark has write permissions to Start extraction only if Ark has proper permissions.
elvisangelaccio edited edge metadata.
elvisangelaccio set the repository for this revision to R36 Ark.

Check also for destination directories which are writable but not executable. Update also the error message accordingly.

rthomsen added inline comments.Nov 18 2015, 8:16 PM
kerfuffle/jobs.cpp
271

"the right permissions" -> "sufficient permissions"