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

"qmake -install qinstall" with a folder fails, if it contains a read-only file

    XMLWordPrintable

Details

    • Windows
    • 31e0d171d605159a83dbee3379a38e4dcd1f4b19 (qt/qtbase/5.12)

    Description

      How to Reproduce

      Example folder (regular text file and a file with a read-only flag):

      to-copy
      ├── normal-file.txt
      └── read-only-file.txt

      QMake command:

      qmake.exe -install qinstall to-copy dest

      Error:

      Cannot open dest\read-only-file.txt: Access is denied.


      The command worked without errors on 5.12.2.

      Bug was caused by this change. Code that ensured user write permissions on read-only files on Windows got removed. And since the change, that folder installation retains permissions, instead of changing to 644/755, now it breaks on read-only files.

      On some context, how this was noticed: qtbase code in my env is fetched with all files as read-only by default, and now the process of building Qt via CMake ExternalProject fails on "installing" the qtbase\doc\global folder with qmake.

      Attaching a patch, that returns the permission check before touch. I would assume that if the 'preservePermissions' flag is here to stay, it would make sense to leave the readOnly check there for error-safety reasons.

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            eswcvlad eswcvlad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes