From 6d8e66513294328e257a8ba4964cde5e9db985f3 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Thu, 14 Mar 2024 18:51:15 +0100 Subject: [PATCH] init: set the HOME env var if root 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) --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 2b065c5..b22db05 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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"); } }