Skip to content

fix(devcontainer): use 0o755 for feature directories (missing execute bit)#507

Open
johnstcn wants to merge 3 commits intomainfrom
fix/mkdirall-permissions
Open

fix(devcontainer): use 0o755 for feature directories (missing execute bit)#507
johnstcn wants to merge 3 commits intomainfrom
fix/mkdirall-permissions

Conversation

@johnstcn
Copy link
Copy Markdown
Member

  • Change MkdirAll calls for featuresDir and per-feature featureDir from 0o644 to 0o755.
  • Directories need the execute bit to be traversable by non-root users.

Fixes #506

🤖 Written by a Coder Agent. Will be reviewed by a human.

…s can actually walk into them

MkdirAll was called with 0o644 (rw-r--r--) which drops the execute bit
that directories need to be traversable. Harmless on the in-memory
filesystem used in tests, but on a real filesystem non-root container
users couldn't access feature install scripts.

Fixes #506
@johnstcn johnstcn self-assigned this Apr 10, 2026
@johnstcn johnstcn marked this pull request as ready for review April 10, 2026 08:20
@johnstcn johnstcn requested review from Copilot and mafredri April 10, 2026 08:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes feature extraction directory permissions in devcontainer compilation so non-root users can traverse feature directories on real filesystems, addressing issue #506.

Changes:

  • Update the features root directory MkdirAll permission from 0o644 to 0o755.
  • Update each per-feature extraction directory MkdirAll permission from 0o644 to 0o755.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…context

The featuresDir creation already wraps its error, but the per-feature
directory creation returned the raw error. When this fails in the field
you'd get a bare permission/path error with no indication of which
feature or directory caused it.
Copy link
Copy Markdown
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct fix, well-scoped. Two constants changed, two-sentence description, no scope creep. The permission values now match every other production MkdirAll in the codebase (all use 0o755, 0o750, or 0o700).

One concern (P2), two adjacent nits (P4). The P2 is that the fix ships without proof it works: no test asserts the permission value, memfs doesn't enforce permissions, and the integration test runs as root. Five of seven reviewers flagged this independently.

"Revert the fix, all tests stay green. The bug described in #506 has no regression test." -- Bisky

The two P4s are pre-existing issues adjacent to the changed lines, not introduced by this PR.

🤖 This review was automatically generated with Coder Agents.

Extends TestCompileWithFeatures/WithoutBuildContexts to stat the
features root and per-feature directories after Compile and verify
they have 0o755 permissions. memfs preserves the mode argument, so
reverting the fix back to 0o644 will fail this assertion.
@johnstcn johnstcn requested a review from mafredri April 10, 2026 09:29
Copy link
Copy Markdown
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2. F1 (P2, missing regression test) addressed in 3304543 with permission assertions. F2 (P4, unwrapped error) addressed in 670d34b with descriptive wrapping. Both look good.

F3 (P4, featureSha naming) is unresolved: thread was closed with no reply and no code change. This is a pre-existing nit, not introduced by this PR. A brief acknowledgment (e.g. "won't fix, pre-existing") would unblock the next review round. Holding further review until then.

🤖 This review was automatically generated with Coder Agents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: MkdirAll uses 0o644 for feature directories (missing execute bit)

3 participants