From b365356eba63de4324b960df0d7c94cc5acd009f Mon Sep 17 00:00:00 2001 From: Hugh Davenport Date: Mon, 5 Feb 2024 16:35:28 +1300 Subject: [PATCH] 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. --- Userland/Applications/Assistant/Providers.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Applications/Assistant/Providers.cpp b/Userland/Applications/Assistant/Providers.cpp index d80ba65314..348ed0e13c 100644 --- a/Userland/Applications/Assistant/Providers.cpp +++ b/Userland/Applications/Assistant/Providers.cpp @@ -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)) {