-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Summary
PR #738 replaced individual /dev/null file mounts with directory-level tmpfs overlays for credential hiding. However, ~/.npmrc is a file, not a directory. Mounting tmpfs over a file path creates an empty directory at that path, which can confuse tools that check for .npmrc existence.
Problem
In src/docker-manager.ts, the credential hiding logic creates tmpfs mounts for these paths:
~/.docker, ~/.ssh, ~/.aws, ~/.kube, ~/.azure,
~/.config/gcloud, ~/.config/gh, ~/.cargo, ~/.composer, ~/.npmrc
All of these except ~/.npmrc are directories. For directories, tmpfs works correctly - it creates an empty in-memory filesystem that shadows the real directory contents.
For ~/.npmrc (a file), Docker creates an empty directory named .npmrc instead. This means:
test -f ~/.npmrcreturns false (it's a directory now, not a file)test -d ~/.npmrcreturns true (unexpected)npm config listmay behave differently with a directory vs. no file- Tools that check
if [ -e ~/.npmrc ]will see "something exists" but reading it will fail differently than expected
Expected Behavior
~/.npmrc should either:
- Not exist at all (as if the file was deleted), OR
- Exist as an empty file (as the old
/dev/nullmount provided)
Actual Behavior
~/.npmrc becomes an empty directory, which is neither of the expected states.
Proposed Fix
Options:
- Keep
~/.npmrcas a/dev/nullbind mount (revert to the pre-fix: replace /dev/null mounts with tmpfs for credential hiding #738 approach for this single file) - Mount tmpfs on the parent directory if
.npmrcis the only sensitive file there - Use an empty file bind mount instead of tmpfs for file paths
Added By
PR #738 (fix: replace /dev/null mounts with tmpfs for credential hiding). The Copilot PR reviewer flagged this concern but it was suppressed due to low confidence.