qt6-bb10/src/corelib
Simon Hausmann bdb81d0bd1 Avoid re-use of QFileSystemMetaData instance in dir entry listing
We've observed that on machines with SELinux installed but disabled, the
behavior of readdir() changes slightly. In the case of tst_qdir's
entryList QDir::Hidden test case, the listing of the directory contents
returns DT_UNKNOWN for the files and (broken) symlink(s) that are
present. When SELinux is enabled, we do see DT_REG and DT_LNK. Our
fallback to DT_UNKNOWN however resets merely the knownFlags, it does not
reset entryFlags, as all the other cases do.

The bug comes when QDirIteratorPrivate::advance() re-uses the
QFileSystemMetaData instance across iterations, and this way we get the
entryFlags values from a previous iteration (with != DT_UNKNOWN) into
the evaluation of an entry with DT_UNKNOWN.

The more conservative approach to fixing this is here by assuming that
QFileSystemMetaData is not designed for re-use and re-initialize it
explicitly in the iteration.

Change-Id: I875856f5ee63a7072d172033e90d02cf41bcab20
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-09-27 15:45:04 +00:00
..
animation Standardize some "We mean it" comments 2016-08-17 19:51:40 +00:00
arch Merge remote-tracking branch 'origin/5.7' into 5.8 2016-08-29 15:30:17 +02:00
codecs Merge dev into 5.8 2016-08-22 11:30:01 +02:00
doc Merge remote-tracking branch 'origin/5.7' into 5.8 2016-09-22 07:28:34 +02:00
global Merge remote-tracking branch 'origin/5.7' into 5.8 2016-09-21 11:57:52 +02:00
io Avoid re-use of QFileSystemMetaData instance in dir entry listing 2016-09-27 15:45:04 +00:00
itemmodels Merge remote-tracking branch 'origin/5.7' into 5.8 2016-09-22 07:28:34 +02:00
json Merge remote-tracking branch 'origin/5.7' into 5.8 2016-08-29 15:30:17 +02:00
kernel Doc: several minor doc issues 2016-09-27 08:30:30 +00:00
mimetypes Use QString::fromLatin1() less to avoid string allocations 2016-09-15 15:55:57 +00:00
plugin Merge dev into 5.8 2016-08-22 11:30:01 +02:00
statemachine fix build with various QT_NO_* defines 2016-08-26 07:39:53 +00:00
thread Correct the C++ standard references in QMutex functions 2016-09-16 15:33:46 +00:00
tools Merge remote-tracking branch 'origin/5.7' into 5.8 2016-09-21 11:57:52 +02:00
xml Support C++17 fallthrough attribute 2016-08-19 18:38:53 +00:00
Qt5CTestMacros.cmake Merge remote-tracking branch 'origin/5.6' into 5.7 2016-04-04 08:59:18 +02:00
Qt5Config.cmake.in
Qt5CoreConfigExtras.cmake.in Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
Qt5CoreConfigExtrasMkspecDir.cmake.in
Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
Qt5CoreMacros.cmake Make moc obey the preprocessor environment variable for include paths 2016-07-20 02:54:09 +00:00
QtCore.dynlist
configure.json Convert the old feature system 2016-09-15 08:24:10 +00:00
corelib.pro Convert the old feature system 2016-09-15 08:24:10 +00:00
eval.pri
qtzlib.pro make a proper header-only module for QtZlib 2015-11-17 20:22:17 +00:00