su: Change the HOME enviroment variable on login
This commit is contained in:
parent
defe7b4ecc
commit
4054c35e9a
Notes:
sideshowbarker
2024-07-17 11:18:29 +09:00
Author: https://github.com/cqundefine Commit: https://github.com/SerenityOS/serenity/commit/4054c35e9a Pull-request: https://github.com/SerenityOS/serenity/pull/13439 Issue: https://github.com/SerenityOS/serenity/issues/13436
1 changed files with 3 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, Undefine <undefine@undefine.pl>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -48,6 +49,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
TRY(Core::System::pledge("stdio exec"));
|
||||
|
||||
TRY(Core::System::setenv("HOME"sv, account.home_directory(), true));
|
||||
|
||||
execl(account.shell().characters(), account.shell().characters(), nullptr);
|
||||
perror("execl");
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue