Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119849

QZip setting wrong Exe* permissions



    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.6.0
    • Core: I/O
    • None
    • All


      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;


          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.


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            thiago Thiago Macieira
            tiho_d Tihomir Dolapchiev
            0 Vote for this issue
            2 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes