From fc2fcacfcc5e644a3463f34e007e89c5f8bfdf22 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 2 Oct 2014 11:49:55 -0700 Subject: 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 --- src/corelib/io/qstandardpaths_unix.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qstandardpaths_unix.cpp') 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(); -- cgit v1.2.3