Details
Description
https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/mimetypes/qmimedatabase.cpp#n446 introduced an optimisation to call QT_STAT directly instead of using QFileInfo on Q_OS_UNIX.
This does not work for custom FileSystemEngines.
When the QT_STAT returns != 0, it will then skip the initial check for if it is a directory and may try to open the path as a file and get its contents (which will fail for directories).
In case the QT_STAT fails, a check using QFileInfo::isDir should still be done first to return directoryMimeType().
Attachments
Issue Links
- mentioned in
-
Page Loading...
For Gerrit Dashboard: QTBUG-110707 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
457409,4 | QMimeDatabase: don't stat() something that isn't a local file | dev | qt/qtbase | Status: MERGED | +2 | 0 |
457411,1 | QMimeDatabase: handle QResource paths in mimeTypeForFile() | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
458142,2 | QMimeDatabase: don't stat() something that isn't a local file | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
458143,2 | QMimeDatabase: don't stat() something that isn't a local file | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |