libzip: Support file permissions when creating/opening archives
ClosedPublic

Authored by rthomsen on Oct 15 2017, 9:25 AM.

Details

Summary

Permissions are read and set in the external attributes.

Currently we dont show the first character of the permissions string (d for directory, l for symlink, etc.). Should we also add this?

BUG: 382815

Test Plan
  • Open a zip archive using the libzip plugin and check that permissions are correctly shown in the Mode column.
  • Create a zip archive using the libzip plugin and check that permissions are correctly set in the archive.

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.
rthomsen created this revision.Oct 15 2017, 9:25 AM
Restricted Application added subscribers: Ark, kde-utils-devel. · View Herald TranscriptOct 15 2017, 9:25 AM
rthomsen updated this revision to Diff 20812.Oct 15 2017, 6:18 PM
rthomsen retitled this revision from libzip: Read permissions when listing to libzip: Support file permissions when creating/opening archives.
rthomsen edited the summary of this revision. (Show Details)
rthomsen edited the test plan for this revision. (Show Details)

Also set permissions in archive when adding files.

rthomsen edited the summary of this revision. (Show Details)Oct 15 2017, 6:22 PM
ltoscano edited the summary of this revision. (Show Details)Oct 15 2017, 6:35 PM
elvisangelaccio accepted this revision.Oct 16 2017, 5:36 PM
elvisangelaccio added inline comments.
plugins/libzipplugin/libzipplugin.cpp
242

QT_STAT(QFile::encodeName(...))

This revision is now accepted and ready to land.Oct 16 2017, 5:36 PM
rthomsen updated this revision to Diff 20915.Oct 17 2017, 5:53 PM

Implement permission handling in copyFiles(). This necessitated removing the in-loop emitEntryForIndex() call and instead calling list() after the entries are copied.

rthomsen updated this revision to Diff 20956.Oct 18 2017, 5:15 PM

Show file type in permissions.

plugins/libzipplugin/libzipplugin.cpp
240

Why this ifdef?

rthomsen marked an inline comment as done.Oct 21 2017, 2:19 PM
rthomsen added inline comments.
plugins/libzipplugin/libzipplugin.cpp
240

We set the UNIX-type file permissions (ZIP_OPSYS_UNIX), so we dont want to do this on Windows.

elvisangelaccio accepted this revision.Oct 21 2017, 3:00 PM

Please push to master (there is a new string).