summaryrefslogtreecommitdiff
path: root/Userland/Services/Taskbar/main.cpp
diff options
context:
space:
mode:
authorPAUL007 <addicteda1@protonmail.com>2021-06-22 17:30:57 +0530
committerAndreas Kling <kling@serenityos.org>2021-06-22 22:48:32 +0200
commit3d42297ecdf82ddf82ccec8c715468b99e79ab88 (patch)
treedcb86ceda548eb8f645dde9491a41cde3beb79a7 /Userland/Services/Taskbar/main.cpp
parent8a3c9d98514cd73e30059983089f3a0d33b86819 (diff)
downloadserenity-3d42297ecdf82ddf82ccec8c715468b99e79ab88.zip
Taskbar: Check if executable in .af exist in filesystem
This adds access X_OK check in discover_apps_and_categories() to see executable specified in .af files exist before registering them for start menu.
Diffstat (limited to 'Userland/Services/Taskbar/main.cpp')
-rw-r--r--Userland/Services/Taskbar/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Services/Taskbar/main.cpp b/Userland/Services/Taskbar/main.cpp
index 9e98cf3170..76f0c11094 100644
--- a/Userland/Services/Taskbar/main.cpp
+++ b/Userland/Services/Taskbar/main.cpp
@@ -87,8 +87,10 @@ Vector<String> discover_apps_and_categories()
{
HashTable<String> seen_app_categories;
Desktop::AppFile::for_each([&](auto af) {
- g_apps.append({ af->executable(), af->name(), af->category() });
- seen_app_categories.set(af->category());
+ if (access(af->executable().characters(), X_OK) == 0) {
+ g_apps.append({ af->executable(), af->name(), af->category() });
+ seen_app_categories.set(af->category());
+ }
});
quick_sort(g_apps, [](auto& a, auto& b) { return a.name < b.name; });