D20122: Properly handle locked RAR archives

Ragnar Thomsen noreply at phabricator.kde.org
Sat Mar 30 11:48:54 GMT 2019


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
  RAR archives can have a "locked" property essentially making them readonly. Currently, Ark doesn't handle this properly and fails silently if the user tries to modify the archive (e.g. adding files).
  
  See bug 368851 <https://bugs.kde.org/show_bug.cgi?id=368851>. Note that the archive mentioned in this bug opens as readonly due the file permissions being `400`.
  
  This diff adds a virtual method `ReadOnlyArchiveInterface::isLocked()` with a default implementation returning `false`. The method is overridden by the RAR plugin which checks if the archive is locked when listing. `ReadWriteArchiveInterface::isReadOnly()` checks `isLocked()` when determining the readonly status of the archive.
  
  Currently, the user is not notified that the archive is locked. Maybe this should be exposed somewhere in the GUI.

TEST PLAN
  Open a locked RAR archive using the `clirar` plugin, e.g. the one in bug 368851 <https://bugs.kde.org/show_bug.cgi?id=368851>.  Make sure the user has write permission to the archive and verify that the archive is opened as readonly.

REPOSITORY
  R36 Ark

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

AFFECTED FILES
  kerfuffle/archiveinterface.cpp
  kerfuffle/archiveinterface.h
  plugins/clirarplugin/cliplugin.cpp
  plugins/clirarplugin/cliplugin.h

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


More information about the Kde-utils-devel mailing list