Skip to content

Commit

Permalink
user_init.c: set HOME
Browse files Browse the repository at this point in the history
Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
  • Loading branch information
navi-desu committed Jul 21, 2024
1 parent 0dcc569 commit 12b194b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/user_init/user_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ int main(int argc, char **argv) {
|| setuid(user->pw_uid) == -1)
return 1;

setenv("HOME", user->pw_dir, true);
xasprintf(&cmd, "%s %s", USERINIT, argv[2]);
execl(user->pw_shell, user->pw_shell, "-c", cmd, NULL);
}

0 comments on commit 12b194b

Please sign in to comment.