D22502: [FileIndexerConfig] skip invalid entries from included/excludedFolders
Igor Poboiko
noreply at phabricator.kde.org
Wed Jul 17 10:18:15 BST 2019
poboiko created this revision.
poboiko added reviewers: Baloo, bruns, ngraham.
Herald added projects: Frameworks, Baloo.
poboiko requested review of this revision.
REVISION SUMMARY
It is possible to create an invalid entry inside includedFolders, for example:
by creating some folder, adding it to config and then deleting it.
If such entry appears inside config, for example, `IndexCleaner` will go mad:
it calculates the id of each entry from the config (which for non-existent
file resolves to 0), and then calls `tr.removeRecursively(0, shouldDelete)`.
Which either crashes due to assert (if it's a debug build) or silently runs
`removeRecursively` for the whole tree.
This patch omits invalid entries when building folders cache inside config,
and adds unit test for such case
TEST PLAN
ctest
REPOSITORY
R293 Baloo
BRANCH
removed-include-folder (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D22502
AFFECTED FILES
autotests/unit/file/fileindexerconfigtest.cpp
autotests/unit/file/fileindexerconfigtest.h
src/file/fileindexerconfig.cpp
To: poboiko, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, LeGast00n, sbergeron, fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190717/ef58f865/attachment.html>
More information about the Kde-frameworks-devel
mailing list