mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 23:42:53 +03:00
Assistant: Check for access before showing results
This commit is contained in:
parent
6f6a2dc319
commit
7c88ab2836
Notes:
sideshowbarker
2024-07-17 00:53:02 +09:00
Author: https://github.com/hughdavenport Commit: https://github.com/SerenityOS/serenity/commit/7c88ab2836 Pull-request: https://github.com/SerenityOS/serenity/pull/22597 Reviewed-by: https://github.com/ADKaster ✅
@ -66,7 +66,9 @@ void URLResult::activate() const
|
||||
AppProvider::AppProvider()
|
||||
{
|
||||
Desktop::AppFile::for_each([this](NonnullRefPtr<Desktop::AppFile> app_file) {
|
||||
m_app_file_cache.append(move(app_file));
|
||||
if (access(app_file->executable().characters(), X_OK) == 0) {
|
||||
m_app_file_cache.append(move(app_file));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -224,6 +226,10 @@ void FileProvider::build_filesystem_cache()
|
||||
return IterationDecision::Continue;
|
||||
|
||||
auto full_path = LexicalPath::join(directory.path().string(), entry.name).string();
|
||||
|
||||
if (access(full_path.characters(), X_OK) != 0)
|
||||
return IterationDecision::Continue;
|
||||
|
||||
m_full_path_cache.append(full_path);
|
||||
|
||||
if (S_ISDIR(st.st_mode)) {
|
||||
|
Loading…
Reference in New Issue
Block a user