1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:37:42 +00:00

Userland: Rely on a single authoritative source for the default PATH

This commit is contained in:
Tim Schumacher 2022-08-20 17:01:53 +02:00 committed by Linus Groh
parent 61e18c681b
commit 39a3775f48
7 changed files with 14 additions and 7 deletions

View file

@ -10,6 +10,7 @@
#include <AK/Types.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h>
#include <LibCore/File.h>
#include <LibCore/TCPServer.h>
#include <LibMain/Main.h>
#include <fcntl.h>
@ -71,7 +72,7 @@ static void run_command(int ptm_fd, String command)
args[1] = "-c";
args[2] = command.characters();
}
char const* envs[] = { "TERM=xterm", "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin", nullptr };
char const* envs[] = { "TERM=xterm", "PATH=" DEFAULT_PATH, nullptr };
rc = execve("/bin/Shell", const_cast<char**>(args), const_cast<char**>(envs));
if (rc < 0) {
perror("execve");