diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-10-02 11:49:55 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2014-10-31 03:57:02 +0100 |
commit | fc2fcacfcc5e644a3463f34e007e89c5f8bfdf22 (patch) | |
tree | 7f1324b4444f860d3b075c6ba3e734c9f1a8ab7a /src/corelib/io | |
parent | 85da1625e47cadf0b41e24863e8988e771e50943 (diff) |
Don't always chmod the XDG_RUNTIME_DIR
Since the current user is the owner of the dir, we'll get 0x7700 as
permissions, not just 0x700. With the wrong check, we were always doing
an unnecessary chmod.
Task-number: QTBUG-41735
Change-Id: Ib1fc258fef4bf526baa9c71201f9b78d36f5454f
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qstandardpaths_unix.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index 469c223b00..2d08c1c4e6 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -131,8 +131,10 @@ QString QStandardPaths::writableLocation(StandardLocation type) return QString(); } // "and he MUST be the only one having read and write access to it. Its Unix access mode MUST be 0700." + // since the current user is the owner, set both xxxUser and xxxOwner QFile file(xdgRuntimeDir); - const QFile::Permissions wantedPerms = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser; + const QFile::Permissions wantedPerms = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser + | QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner; if (file.permissions() != wantedPerms && !file.setPermissions(wantedPerms)) { qWarning("QStandardPaths: wrong permissions on runtime directory %s", qPrintable(xdgRuntimeDir)); return QString(); |