What changed, and why it matters
This change simply renames Docker containers used by the project's build scripts so they include the current user's name. That prevents two users on the same computer from accidentally using or overwriting each other's development containers. It does not touch the firmware, wallet logic, cryptography, or any user-facing security feature.
No security action needed. Treat as a routine developer-experience improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies two shell helper scripts (scripts/docker_exec.sh and scripts/dockerenv.sh). It adds a container_user() helper that reads the current Unix username, lowercases it, and sanitizes non-alphanumeric characters, then embeds that username into the Docker container name. Previously the container name was derived only from the project directory name, which could collide across multiple users on a shared machine. The change is purely a local development workflow convenience and has no effect on the shipped firmware or its attack surface.
Changed components
scripts/docker_exec.shscripts/dockerenv.shInspect captured patch +29 / −3
diff --git a/scripts/docker_exec.sh b/scripts/docker_exec.sh
index e9587cc..fdd7baf 100755
--- a/scripts/docker_exec.sh
+++ b/scripts/docker_exec.sh
@@ -2,8 +2,21 @@
# SPDX-License-Identifier: Apache-2.0
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-PROJECT_NAME="$(basename $(realpath "$DIR/.."))"
-CONTAINER_NAME=$PROJECT_NAME-dev
+PROJECT_NAME="$(basename "$(realpath "$DIR/..")")"
+
+container_user() {
+ local user
+ user="$(id -un 2>/dev/null || true)"
+ user="$(printf '%s' "$user" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9_.-]+/-/g; s/^-+//; s/-+$//')"
+ if [ -z "$user" ]; then
+ echo "Could not derive a valid username for container naming." >&2
+ exit 1
+ fi
+ printf '%s' "$user"
+}
+
+CONTAINER_USER="$(container_user)"
+CONTAINER_NAME="${CONTAINER_USER}-${PROJECT_NAME}-dev"
if [ -n "$CONTAINER_RUNTIME" ]; then
RUNTIME="$CONTAINER_RUNTIME"
diff --git a/scripts/dockerenv.sh b/scripts/dockerenv.sh
index 9a1f71a..c6c4e0d 100755
--- a/scripts/dockerenv.sh
+++ b/scripts/dockerenv.sh
@@ -22,7 +22,20 @@ fi
CONTAINER_IMAGE=shiftcrypto/firmware_v2
CONTAINER_VERSION=${CONTAINER_VERSION:-$(cat .containerversion)}
PROJECT_NAME="$(basename "$(realpath "$DIR/..")")"
-CONTAINER_NAME="$PROJECT_NAME-$CONTAINER_NAME_SUFFIX"
+
+container_user() {
+ local user
+ user="$(id -un 2>/dev/null || true)"
+ user="$(printf '%s' "$user" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9_.-]+/-/g; s/^-+//; s/-+$//')"
+ if [ -z "$user" ]; then
+ echo "Could not derive a valid username for container naming." >&2
+ exit 1
+ fi
+ printf '%s' "$user"
+}
+
+CONTAINER_USER="$(container_user)"
+CONTAINER_NAME="${CONTAINER_USER}-${PROJECT_NAME}-${CONTAINER_NAME_SUFFIX}"
dockerdev () {
local repo_path="$DIR/.."
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.