summaryrefslogtreecommitdiff
path: root/Applications/Taskbar/TaskbarWindow.cpp
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2020-03-16 22:30:52 +0200
committerAndreas Kling <kling@serenityos.org>2020-03-18 08:23:31 +0100
commitc18f12bb96a3145efff68e12c682cdae57527ea9 (patch)
tree0f651cc536a2467761de6df8e28634f1af9b5fa5 /Applications/Taskbar/TaskbarWindow.cpp
parente2b7e7c390de61b341897310d6e3e1fdf56b703a (diff)
downloadserenity-c18f12bb96a3145efff68e12c682cdae57527ea9.zip
Taskbar: chdir to home directory before launching apps
Diffstat (limited to 'Applications/Taskbar/TaskbarWindow.cpp')
-rw-r--r--Applications/Taskbar/TaskbarWindow.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Applications/Taskbar/TaskbarWindow.cpp b/Applications/Taskbar/TaskbarWindow.cpp
index 6b0c3c786d..22dd71906e 100644
--- a/Applications/Taskbar/TaskbarWindow.cpp
+++ b/Applications/Taskbar/TaskbarWindow.cpp
@@ -28,6 +28,7 @@
#include "TaskbarButton.h"
#include <AK/SharedBuffer.h>
#include <LibCore/ConfigFile.h>
+#include <LibCore/UserInfo.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
#include <LibGUI/Desktop.h>
@@ -105,6 +106,10 @@ void TaskbarWindow::create_quick_launch_bar()
if (pid < 0) {
perror("fork");
} else if (pid == 0) {
+ if (chdir(get_current_user_home_path().characters()) < 0) {
+ perror("chdir");
+ exit(1);
+ }
execl(app_executable.characters(), app_executable.characters(), nullptr);
perror("execl");
ASSERT_NOT_REACHED();