diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-09-10 08:27:13 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-09-10 08:27:13 (GMT) |
commit | 27d3905f3d08ef0498ceba1eeb367403cf9f2980 (patch) | |
tree | 21595c15c4b2ed101cbe6d14a9d90382f3154075 /src/corelib/io/qfsfileengine.cpp | |
parent | 20a61e1cf39ee66cf0880c6f8f36634115cf610e (diff) | |
download | Qt-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.cpp | 10 |
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(); |