diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2010-03-23 14:03:24 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:05:27 (GMT) |
commit | d451dfaeee0d1a770c95cb11b963b496d235df8b (patch) | |
tree | 5692ea7dffdede83ae7d85174872a335f6033b22 /src/corelib | |
parent | 2f92ccd2a930870e4d768ba72e08278415f29751 (diff) | |
download | Qt-d451dfaeee0d1a770c95cb11b963b496d235df8b.zip Qt-d451dfaeee0d1a770c95cb11b963b496d235df8b.tar.gz Qt-d451dfaeee0d1a770c95cb11b963b496d235df8b.tar.bz2 |
QFSFileEngine: don't look through NTFS junctions
Starting in 1216161584b730576c24fb128131838be1826b37, we started
processing NTFS junctions as symbolic link.
This reverts isSymlink() behavior back to former behavior and processes
only symbolic junctions. The code path there worked just fine for
directory symbolic links but lead to multiple issues for volume mount
point junctions due to incompleteness.
Task-number: QTBUG-7036, QTBUG-7384
Merge-request: 493
Reviewed-by: João Abecasis <joao@trolltech.com>
(cherry picked from commit b4996ab8e3a26d45ee55593da281e4b798c04dd2)
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfsfileengine_win.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 14d14d6..77c99e0 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1266,12 +1266,7 @@ static QString readSymLink(const QString &link) REPARSE_DATA_BUFFER *rdb = (REPARSE_DATA_BUFFER*)qMalloc(bufsize); DWORD retsize = 0; if (::DeviceIoControl(handle, FSCTL_GET_REPARSE_POINT, 0, 0, rdb, bufsize, &retsize, 0)) { - if (rdb->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) { - int length = rdb->MountPointReparseBuffer.SubstituteNameLength / sizeof(wchar_t); - int offset = rdb->MountPointReparseBuffer.SubstituteNameOffset / sizeof(wchar_t); - const wchar_t* PathBuffer = &rdb->MountPointReparseBuffer.PathBuffer[offset]; - result = QString::fromWCharArray(PathBuffer, length); - } else { + if (rdb->ReparseTag == IO_REPARSE_TAG_SYMLINK) { int length = rdb->SymbolicLinkReparseBuffer.SubstituteNameLength / sizeof(wchar_t); int offset = rdb->SymbolicLinkReparseBuffer.SubstituteNameOffset / sizeof(wchar_t); const wchar_t* PathBuffer = &rdb->SymbolicLinkReparseBuffer.PathBuffer[offset]; @@ -1531,8 +1526,7 @@ bool QFSFileEnginePrivate::isSymlink() const if (hFind != INVALID_HANDLE_VALUE) { ::FindClose(hFind); if ((findData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) - && (findData.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT - || findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK)) { + && findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK) { is_link = true; } } |