summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-10-02 11:56:22 -0700
committerThiago Macieira <thiago.macieira@intel.com>2014-10-31 03:57:19 +0100
commitd0ed6dc1464bd4b62b765060901de708eec5687d (patch)
tree062158b7718c69b5cc723273b1e05c8a6a111722 /src/corelib/io
parentfc2fcacfcc5e644a3463f34e007e89c5f8bfdf22 (diff)
Report the system error on why chmod(2) failed in XDG_RUNTIME_DIR
This is a very rare occurrence: if the user is the owner of the directory, the user can chmod(2), and we already checked that the user is the owner. However, chmod(2) can still fail on read-only fs and on hardened systems. Task-number: QTBUG-41735 Change-Id: I8f8bac763bf5a6e575ed59dac55bd265e5b66271 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index 2d08c1c4e6..2ad6dfa121 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -136,7 +136,8 @@ QString QStandardPaths::writableLocation(StandardLocation type)
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));
+ qWarning("QStandardPaths: could not set correct permissions on runtime directory %s: %s",
+ qPrintable(xdgRuntimeDir), qPrintable(file.errorString()));
return QString();
}
return xdgRuntimeDir;