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

UNIX: QSaveFile fails to write after changing the file name using setFileName() when hitting on a read-only file first

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.13.0 RC 3
    • Fix Version/s: 5.12.5, 5.13.1, 5.14.0 Alpha
    • Component/s: Core: I/O
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      54684f10e90b2ab1705cad97dd0a5d3942f06cc3 (qt/qtbase/5.12)

      Description

      Consider an editor application implementing its save function such that it instantiates a QSaveFile and gives the user a way to retry with a different name should saving fail (implement a loop using QSaveFile::setFileName() ).

      Steps to reproduce:

      • Create a file and chmod ugo-w
      • Open the editor
      • Save, enter new file name

      Expected: Saving works
      Actual: QSaveFile::write() returns -1, commit fails

      This was observed for https://codereview.qt-project.org/c/qt/qttools/+/264690 and a test would look like https://codereview.qt-project.org/c/qt/qtbase/+/267669 .

        Attachments

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

          Activity

            People

            • Assignee:
              kleint Friedemann Kleint
              Reporter:
              kleint Friedemann Kleint
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes