From d360340b9ee9b6bfacee37fcbcfbeade8a0649a7 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 12 Jun 2023 01:26:10 +0300 Subject: [PATCH] Userspace: init now sets HOME environment variable and cd's into HOME --- userspace/init/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/userspace/init/main.cpp b/userspace/init/main.cpp index c39ee92b..fa5a7a42 100644 --- a/userspace/init/main.cpp +++ b/userspace/init/main.cpp @@ -144,6 +144,9 @@ int main() if (setuid(user.uid) == -1) perror("setuid"); + setenv("HOME", user.home.data(), 1); + chdir(user.home.data()); + execl(user.shell.data(), user.shell.data(), nullptr); perror("execl");