1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00

Taskbar: chdir to home directory before launching apps

This commit is contained in:
Itamar 2020-03-16 22:30:52 +02:00 committed by Andreas Kling
parent e2b7e7c390
commit c18f12bb96

View file

@ -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();