File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ if [ -n "${HOST_UID}" ] && [ -n "${HOST_GID}" ]; then
2626 " ${USER_NAME} "
2727 else
2828 USER_NAME=$( getent passwd " ${HOST_UID} " | cut -d: -f1)
29+ usermod --home " ${USER_HOME} " " ${USER_NAME} "
2930 fi
3031
3132 # Passwordless sudo
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ if [[ "${1:-}" == --assert ]]; then
77 exit 1
88 fi
99 test " $( id -u) " = " $2 "
10+ account_home=$( getent passwd " $2 " | cut -d: -f6)
11+ if [[ " ${account_home} " != " ${HOME} " ]]; then
12+ echo " Account home=${account_home} , HOME=${HOME} " >&2
13+ exit 1
14+ fi
1015 test " $( cat " ${HOME} /.claude/settings.json" ) " = fixture
1116 echo updated > " ${HOME} /.claude/settings.json"
1217 echo " UID $2 reads and writes settings through HOME"
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ correct ownership on the host. The entrypoint:
1351352 . Sources ` env.sh ` to set up tool paths
1361363 . Drops privileges via ` setpriv ` before running the command
137137
138- The mapped user always uses ` /home/claude-user ` as ` HOME ` .
138+ The mapped user's account record and ` HOME ` both use ` /home/claude-user ` .
139139This keeps the settings and cache mounts visible when the base image already has an account with the host UID.
140140
141141Run the entrypoint regression check in disposable containers:
@@ -152,6 +152,7 @@ CONTAINER_ENGINE=podman bash docker/test-claude-entrypoint.sh
152152
153153The check covers an existing UID and a new UID.
154154It verifies that the launched command can read and write fixture settings through ` HOME ` .
155+ It also checks that the account's recorded home matches ` HOME ` .
155156
156157### ` claude.sh `
157158
You can’t perform that action at this time.
0 commit comments