summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfsfileengine.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-09-10 08:27:13 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-09-10 08:27:13 (GMT)
commit27d3905f3d08ef0498ceba1eeb367403cf9f2980 (patch)
tree21595c15c4b2ed101cbe6d14a9d90382f3154075 /src/corelib/io/qfsfileengine.cpp
parent20a61e1cf39ee66cf0880c6f8f36634115cf610e (diff)
downloadQt-27d3905f3d08ef0498ceba1eeb367403cf9f2980.zip
Qt-27d3905f3d08ef0498ceba1eeb367403cf9f2980.tar.gz
Qt-27d3905f3d08ef0498ceba1eeb367403cf9f2980.tar.bz2
Fixed various PlatSec violations when app had no AllFiles capability.
Fixed QtCore in various places that caused Platform Security violations in Symbian if AllFiles capability was missing from the application. All of these these were caused by trying to access /private folder unnecessarily, either by Qt code or Open C. Task-number: 249008 Reviewed-by: Janne Koskinen
Diffstat (limited to 'src/corelib/io/qfsfileengine.cpp')
-rw-r--r--src/corelib/io/qfsfileengine.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index b9e4061..7d31396 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -157,7 +157,15 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path)
#endif
separatorPos = tmpPath.indexOf(slash, separatorPos + 1);
QString prefix = separatorPos == -1 ? tmpPath : tmpPath.left(separatorPos);
- if (!nonSymlinks.contains(prefix)) {
+ if (
+#ifdef Q_OS_SYMBIAN
+ // Symbian doesn't support directory symlinks, so do not check for link unless we
+ // are handling the last path element. This not only slightly improves performance,
+ // but also saves us from lot of unnecessary platform security check failures
+ // when dealing with files under *:/private directories.
+ separatorPos == -1 &&
+#endif
+ !nonSymlinks.contains(prefix)) {
fi.setFile(prefix);
if (fi.isSymLink()) {
QString target = fi.symLinkTarget();