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

QTemporaryFile fail to rename on linux with cross-device

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • None
    • 5.11.2
    • Core: I/O
    • None

    Description

      Bug detected on linux :

      I create a QTemporaryFile on device A (ex: /tmp mount on sda1)

      rename this QTemporaryFile to file on device B (/home mount on sdb1)

      You get "Invalid cross-device link" error.

       

      qtRename.cpp reproduce the bug.

      $ sudo mount -B source_dir target_dir

      $ qtRename target_dir/file.txt

       

      probleme come from reimplementation of QTemporaryFile::rename method that don't fallback to copy file when other methods fails.

      QFile::rename use this fallback

       

      qt-qtbase-rename_on_unix_bug.patch fix

       

       

      Attachments

        1. qt-qtbase-rename_on_unix_bug.patch
          6 kB
        2. qtRename.cpp
          0.5 kB
        3. qtRename.pro
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            ledocc David Callu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes