From b22f1eba6cc72c6d9a6d3317ccab51872e8e6d9c Mon Sep 17 00:00:00 2001 From: Joerg Behrmann Date: Wed, 29 Nov 2023 11:20:08 +0100 Subject: [PATCH] mounts: use INVOKING_USER in mount_passwd instead of hardcoding /home --- mkosi/mounts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkosi/mounts.py b/mkosi/mounts.py index 61e687790..c8e6f25ca 100644 --- a/mkosi/mounts.py +++ b/mkosi/mounts.py @@ -157,7 +157,8 @@ def mount_passwd(root: Path = Path("/")) -> Iterator[None]: passwd.write("root:x:0:0:root:/root:/bin/sh\n") if INVOKING_USER.uid != 0: name = INVOKING_USER.name() - passwd.write(f"{name}:x:{INVOKING_USER.uid}:{INVOKING_USER.gid}:{name}:/home/{name}:/bin/sh\n") + home = INVOKING_USER.home() + passwd.write(f"{name}:x:{INVOKING_USER.uid}:{INVOKING_USER.gid}:{name}:{home}:/bin/sh\n") passwd.flush() os.fchown(passwd.file.fileno(), INVOKING_USER.uid, INVOKING_USER.gid) -- 2.47.2