SUMMARY When $HOME is set with a trailing slash (something caused /etc/passwd to be set like that, not sure what, pretty sure it wasn't manual), the exclude folder list generated by the Baloo System Settings configuration module contains paths with double slash components: ----8<---- $ grep exclude\ folders ~/.config/baloofilerc exclude folders[$e]=$HOME/.cache/,$HOME/mnt/,$HOME/snap/ $ balooctl config show excludeFolders kf.baloo: Folder cache: std::vector("/home/odeda//.cache/": excluded, "/home/odeda//snap/": excluded, "/home/odeda//mnt/": excluded, "/home/odeda/": included) /home/odeda//.cache/ /home/odeda//snap/ /home/odeda//mnt/ ----8<---- When that happens, baloo ignores the exclude folders configuration and scans the excluded paths. STEPS TO REPRODUCE 1. Setup /etc/password with a slash at the end of your home directory, log out and back in 2. Use System Settings to remove all excluded folders and then add some back in 3. Wait for baloo to start indexing files OBSERVED RESULT Baloo indexes files in the excluded folders. EXPECTED RESULT Baloo should understand that `//` isn't referring to a directory with an empty name and should be canonicallized in the same way that coreutils' realpath does it, and not scan excluded folders. SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Plasma Version: 5.21.80 KDE Frameworks Version: 5.81.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION
Can confirm...
Interesting. I'll investigate.
(In reply to Nate Graham from comment #2) > Interesting. I'll investigate. This change solved the problem for me: https://invent.kde.org/frameworks/baloo/-/merge_requests/43
Oh nice! An alternative or supplemental solution might be to sanitize the input paths entered using the KCM, which lives in plasma-desktop.
(In reply to Nate Graham from comment #4) > Oh nice! > > An alternative or supplemental solution might be to sanitize the input paths > entered using the KCM, which lives in plasma-desktop. That wouldn't work as an alternative in this case as the KCM sets up the paths using $HOME/ (and I think that's correct) so in my case KCM would still cause the config file to contain the double slash. That code change, does cause the KCM to display the configured paths as "~//folder name", which is a bit weird, so some modification there might also be in order - I'll take a look.
Git commit 7b0cab3aa4b1c8b1eb6a393c2226630923998da5 by Oded Arbel. Committed on 21/04/2021 at 07:45. Pushed by ngraham into branch 'master'. When adding a folder to configuration, normalize the path semantically The folder path is later used in string matches so it must be normalized by removing double directory sepearators, up dir and other valid Unix directory spec parts that are valid but confuse `canBeSearched()`. M +1 -1 src/file/fileindexerconfig.cpp https://invent.kde.org/frameworks/baloo/commit/7b0cab3aa4b1c8b1eb6a393c2226630923998da5