diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-09-27 13:13:44 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-09-27 15:45:04 +0000 |
commit | bdb81d0bd13eb39e1b31b19e5c25112a532b2ffb (patch) | |
tree | 6885ee9d78a43e30f4c15faa1f0147f1cd4930f9 /src/src.pro | |
parent | 3efb84ffdbcfbd9969b765b7cffd01da231e7ba6 (diff) | |
download | qtbase-bdb81d0bd13eb39e1b31b19e5c25112a532b2ffb.tar.gz |
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>
Diffstat (limited to 'src/src.pro')
0 files changed, 0 insertions, 0 deletions