Skip to content

Re-apply denyRead file masks after a denyWrite ancestor bind - #309

Merged
shawnm-anthropic merged 1 commit into
mainfrom
fix/deny-write-ancestor-unmasks-file
Jun 15, 2026
Merged

shawnm-anthropic merged 1 commit into
mainfrom
fix/deny-write-ancestor-unmasks-file

Conversation

@poteat

@poteat poteat commented Jun 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

TLDR: a read-denied file became readable when denyWrite bound an ancestor on top; re-apply the /dev/null mask after.

The dir variant was fixed in #305 (re-apply tmpfs after the ancestor bind). This is the same fix for file masks: re-emit --ro-bind /dev/null <file> after any emitted denyWrite dest that contains it.

Test Plan

New wrap-with-sandbox.test.ts case asserts the /dev/null mask lands after the ancestor ro-bind in arg order, mirroring the dir-variant test.

Links

A read-denied file is hidden via --ro-bind /dev/null. When a denyWrite
ro-bind on an ancestor directory lands afterward, the real subtree is
re-mounted on top and the file becomes readable again. The existing
re-apply pass covered tmpfs-masked directories but not file masks; this
adds the parallel re-apply for maskedFiles.
@shawnm-anthropic
shawnm-anthropic merged commit e1600a3 into main Jun 15, 2026
8 checks passed
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.

2 participants