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

QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) fails on Ubuntu Touch

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0
    • 5.3.1
    • Core: Other
    • None
    • Ubuntu Touch - 14.10, armhf build
    • fc2fcacfcc5e644a3463f34e007e89c5f8bfdf22 d0ed6dc1464bd4b62b765060901de708eec5687d

    Description

      When QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) is called on Ubuntu Touch, the function returns an empty string and the following log can be seen:
      "QStandardPaths: wrong permissions on runtime directory /run/user/32011"

      The implementation seems to check for User RWX permission and if those are not teh exact permissions, it will try to set them (snippet from QStandardPaths:

             // "and he MUST be the only one having read and write access to it. Its Unix access mode MUST be 0700."
              QFile file(xdgRuntimeDir);
              const QFile::Permissions wantedPerms = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser;
              if (file.permissions() != wantedPerms && !file.setPermissions(wantedPerms)) {
                  qWarning("QStandardPaths: wrong permissions on runtime directory %s", qPrintable(xdgRuntimeDir));
                  return QString();
              }
      

      However file.permissions() return 0x77000 on Ubuntu (also on desktop), which causes the file.setPermissions() to be called.

      Attachments

        For Gerrit Dashboard: QTBUG-41735
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            jombi Zsombor Egri
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes