Userspace: init now sets HOME environment variable and cd's into HOME

This commit is contained in:
Bananymous 2023-06-12 01:26:10 +03:00
parent 0f63cfa43f
commit d360340b9e
1 changed files with 3 additions and 0 deletions

View File

@ -144,6 +144,9 @@ int main()
if (setuid(user.uid) == -1) if (setuid(user.uid) == -1)
perror("setuid"); perror("setuid");
setenv("HOME", user.home.data(), 1);
chdir(user.home.data());
execl(user.shell.data(), user.shell.data(), nullptr); execl(user.shell.data(), user.shell.data(), nullptr);
perror("execl"); perror("execl");