Skip to content

Commit

Permalink
init: set the HOME env var if root
Browse files Browse the repository at this point in the history
When virtme-ng was running as root, the HOME dir was set to '/'.

Now it is set to '/root', the expected value.

Fixes: 6ed126b ("virtme-ng-init: docker host support")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
  • Loading branch information
matttbe committed Mar 14, 2024
1 parent 450872b commit 6d8e665
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ fn setup_root_home() {
utils::do_mkdir("/tmp/roothome");
utils::do_mount("/tmp/roothome", "/root", "", libc::MS_BIND as usize, "");
env::set_var("HOME", "/tmp/roothome");
} else {
env::set_var("HOME", "/root");
}
}

Expand Down

0 comments on commit 6d8e665

Please sign in to comment.