From 785d33be4076b0176dc6ad6ea255037aa09ac524 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 11 Sep 2026 07:41:44 +0200 Subject: [PATCH] core.func: fall back to a usable HOME when the shell has none (#17154) --- misc/core.func | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/core.func b/misc/core.func index 4221d562f..4589c3d4d 100644 --- a/misc/core.func +++ b/misc/core.func @@ -15,6 +15,11 @@ [[ -n "${_CORE_FUNC_LOADED:-}" ]] && return _CORE_FUNC_LOADED=1 +if [[ -z "${HOME:-}" ]]; then + HOME="$(getent passwd "$(id -u)" 2>/dev/null | cut -d: -f6)" + export HOME="${HOME:-/root}" +fi + # ============================================================================== # SECTION 1: INITIALIZATION & SETUP # ==============================================================================