diff options
author | Zeno Albisser <zeno.albisser@nokia.com> | 2010-06-03 14:54:31 (GMT) |
---|---|---|
committer | Zeno Albisser <zeno.albisser@nokia.com> | 2010-06-04 11:25:36 (GMT) |
commit | dbd16b3b6d2e6b030dd52e90eb3a38dc1a73c180 (patch) | |
tree | db88608b8efcbeccf650fb40cebf81d061fb2b17 /src/corelib | |
parent | be627ce374da1e192c740a6b59f4bab6b12798c3 (diff) | |
download | Qt-dbd16b3b6d2e6b030dd52e90eb3a38dc1a73c180.zip Qt-dbd16b3b6d2e6b030dd52e90eb3a38dc1a73c180.tar.gz Qt-dbd16b3b6d2e6b030dd52e90eb3a38dc1a73c180.tar.bz2 |
fix for using .lnk files when running app from UNC
Since "" is an invalid target for a .lnk file,
we can return false for doStat() in case of resolving
the .lnk to "".
Notice that .lnk files only allow absolute paths for the target.
"" is returned by readLink in case the .lnk file does not exist.
Reviewed-by: Joao
Task-Number: QTBUG-10863
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfsfileengine_win.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index ec49f1a..21930e1 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1162,7 +1162,15 @@ bool QFSFileEnginePrivate::doStat() const if (filePath.isEmpty()) return could_stat; - QString fname = filePath.endsWith(QLatin1String(".lnk")) ? readLink(filePath) : filePath; + QString fname; + if(filePath.endsWith(QLatin1String(".lnk"))) { + fname = readLink(filePath); + if(fname.isEmpty()) + return could_stat; + } + else + fname = filePath; + fname = fixIfRelativeUncPath(fname); UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); |