<table><tr><td style="">rthomsen created this revision.<br />rthomsen added a reviewer: elvisangelaccio.<br />rthomsen added a project: Ark.<br />Herald added subscribers: Ark, kde-utils-devel.<br />rthomsen requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D20122">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>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).</p>

<p>See bug <a href="https://bugs.kde.org/show_bug.cgi?id=368851" class="remarkup-link" target="_blank" rel="noreferrer">368851</a>. Note that the archive mentioned in this bug opens as readonly due the file permissions being <tt style="background: #ebebeb; font-size: 13px;">400</tt>.</p>

<p>This diff adds a virtual method <tt style="background: #ebebeb; font-size: 13px;">ReadOnlyArchiveInterface::isLocked()</tt> with a default implementation returning <tt style="background: #ebebeb; font-size: 13px;">false</tt>. The method is overridden by the RAR plugin which checks if the archive is locked when listing. <tt style="background: #ebebeb; font-size: 13px;">ReadWriteArchiveInterface::isReadOnly()</tt> checks <tt style="background: #ebebeb; font-size: 13px;">isLocked()</tt> when determining the readonly status of the archive.</p>

<p>Currently, the user is not notified that the archive is locked. Maybe this should be exposed somewhere in the GUI.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Open a locked RAR archive using the <tt style="background: #ebebeb; font-size: 13px;">clirar</tt> plugin, e.g. the one in bug <a href="https://bugs.kde.org/show_bug.cgi?id=368851" class="remarkup-link" target="_blank" rel="noreferrer">368851</a>.  Make sure the user has write permission to the archive and verify that the archive is opened as readonly.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R36 Ark</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D20122">https://phabricator.kde.org/D20122</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kerfuffle/archiveinterface.cpp<br />
kerfuffle/archiveinterface.h<br />
plugins/clirarplugin/cliplugin.cpp<br />
plugins/clirarplugin/cliplugin.h</div></div></div><br /><div><strong>To: </strong>rthomsen, elvisangelaccio<br /><strong>Cc: </strong>kde-utils-devel, Ark, tctara<br /></div>