Assistant: Check for access before showing file results

Fixing up from #22597.

This change checks whether a file is readable to the user before adding
files to the cache.
This commit is contained in:
Hugh Davenport 2024-02-05 16:35:28 +13:00 committed by Andreas Kling
parent bba53441ef
commit b365356eba

View file

@ -224,6 +224,9 @@ void FileProvider::build_filesystem_cache()
return IterationDecision::Continue;
auto full_path = LexicalPath::join(directory.path().string(), entry.name).string();
if (access(full_path.characters(), R_OK) != 0)
return IterationDecision::Continue;
m_full_path_cache.append(full_path);
if (S_ISDIR(st.st_mode)) {