Resolve HOME to the target user's home directory instead of /root
ResolvedUser now carries home, looked up from the image's own /etc/passwd entry for the final resolved uid (falling back to /root for uid 0 or / otherwise when there's no matching row). bwrap's HOME now uses this whenever a user override applies (--user/--group or an image-declared default user); the plain /root default is kept only when no override applies at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gv3s5jckJKzh6JkMoi2Akz
This commit is contained in:
@@ -45,6 +45,7 @@ std::optional<std::vector<std::string>> wrap_for_root_namespace(const std::strin
|
||||
struct ResolvedUser {
|
||||
int uid;
|
||||
int gid;
|
||||
std::string home; // from the image's /etc/passwd entry for uid, or a sane fallback
|
||||
};
|
||||
|
||||
// Assembles the full bwrap argv (program name included) to run `command` with
|
||||
|
||||
Reference in New Issue
Block a user