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

QZip setting wrong Exe* permissions

    XMLWordPrintable

Details

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

    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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes