Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
6.6.0
-
None
Description
The function permissionsToMode(...) inside qzip.cpp is converting permissions QFile::ExeOwner and QFile::ExeUser to UnixFileAttributes::WriteUser instead of UnixFileAttributes::ExeUser.
As a result, folders within the ZIP archive will be extracted with missing permission attributes which will prevent navigation within the folders and subfolders.
This also causes a problem when using QZipReader::extractAll(). During the decompression of the archive with QZipReader::extractAll() files and folders lose the attribute QFile::ExeOwner and QFile:ExeUser (even if set during archive creation) which is particularly disturbing for folders and prevents folder navigation. The extractAll() function fails to decompress files included in the sub-folders and returns false.
The fix is changing the lines:
if (perms & (QFile::ExeOwner | QFile::ExeUser))
mode |= UnixFileAttributes::WriteUser;
into:
if (perms & (QFile::ExeOwner | QFile::ExeUser))
mode |= UnixFileAttributes::ExeUser;
This is indeed a very old bug since Qt v5 and probably earlier. Previously the fix was rejected as QZip was not part of the public API (QTBUG-54938). As QZip is now part of the public Qt API, I hope this will get some attention and get fixed. Because of this Qt bug, we have to use a third-party ZIP library, which is a pity.
Truly hope this will get some attention and gets fixed sooner than later.