From be09e293e29df1e031c814b06ebd0a8281d25a30 Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Thu, 12 Mar 2026 22:46:38 +0100 Subject: [PATCH] fix(bsd): correct the _ROOT_TMPDIR path for *BSD system (solves #5789) --- cloudinit/temp_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cloudinit/temp_utils.py b/cloudinit/temp_utils.py index faa4aaa287a..f6b52e35d98 100644 --- a/cloudinit/temp_utils.py +++ b/cloudinit/temp_utils.py @@ -20,7 +20,10 @@ def get_tmp_ancestor(odir=None, needs_exe: bool = False): if needs_exe: return _EXE_ROOT_TMPDIR if os.getuid() == 0: - return _ROOT_TMPDIR + if util.is_BSD(): + return "/var/" + _ROOT_TMPDIR + else: + return _ROOT_TMPDIR return os.environ.get("TMPDIR", "/tmp")