mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:04:57 +00:00
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:
parent
bba53441ef
commit
b365356eba
1 changed files with 3 additions and 0 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue