fix(agent): let sandboxed Python stat writable parents #25
No reviewers
Labels
No labels
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Beanstalk!25
Loading…
Reference in a new issue
No description provided.
Delete branch "futondestroyer/Beanstalk-contributions:codex/windows-base-path"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Windows farm builds fail before compiling because Python's os.makedirs(existing_directory, exist_ok=True) checks the parent first. An AppContainer can access the granted directory but cannot stat its parent, so Python recurses until mkdir on the drive root fails with WinError 5. This reproduced with a game-free Python probe as well as the farm reports for Longshot PR 910.
Change
Grant only FILE_READ_ATTRIBUTES (0x80), without inheritance, on each writable root's immediate parent. Do not grant metadata on a drive root, a broad system/profile path or a parent containing protected agent credentials. Read and modify grants retain their existing masks; metadata grants do not subsume nested grants because they do not inherit.
Security review required: two maintainers
This deliberately adds a small amount of directory metadata visibility to the sandbox. The written reason is Python's parent existence check, not access to any parent contents. It grants no listing, file data, execution, sibling writes, permission changes or inherited access. Parents farther up the tree remain inaccessible. The new negative integration checks verify these boundaries. Please obtain the two maintainer reviews required by CONTRIBUTING.md before merging/deploying; this patch has not been installed into the volunteer worker.
Validation
The worker remains on the official signed nightly. No claim is made that a full Longshot base build or gameplay report has passed with this patch; the next acceptance step after reviewed rollout is a normal approved Windows farm job.
Reproduction details and the regression command: docs/windows-makedirs.md.
Included the regression project lockfile generated by the shared agent build settings. Its locked AppContainer run passes, including all five denied-access assertions; the permission scope and two-maintainer review requirement are unchanged.