Repository navigation
Preserve filesystem denials when preparing approved commands - #48155
Merged
copyberry[bot] merged 1 commit intoSep 25, 2026
Conversation
## Why Approved commands need broader write access while retaining explicit read denials. On Linux, binding the filesystem root writable can shadow standard devices, and additional root-metadata mounts can reopen denied symlink targets. ## What changed - Add `FileSystemSandboxPolicy::for_approved_command` to grant root and root-metadata writes while retaining path and glob denials. Keep the original policy when denials cannot be resolved or deny the root. - Restore standard devices after Linux writable root binds, then apply explicit deny masks. Avoid redundant root-alias binds and inherit root-metadata writes from the root mount so denied targets stay masked. - Preserve literal deny paths alongside resolved targets so Linux can reject denials that cross writable symlinks. - Advertise Linux device and approved-root restriction support through two opt-in exec-server capabilities, omitted from serialization when false. ## Testing Add regression coverage for approval policy materialization across Unix, Windows drive, and UNC paths; Windows volume expansion; Linux device access and metadata symlink restrictions; and capability serialization compatibility. GitOrigin-RevId: 40584473da98a15e606bb1a8934308f69528850f
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/40584473da98a15e606bb1a8934308f69528850f
branch
from
September 25, 2026 18:07
ae0cf99 to
645b683
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/40584473da98a15e606bb1a8934308f69528850f
branch
September 25, 2026 18:07
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preserve filesystem denials when preparing approved commands
Why
Approved commands need broader write access while retaining explicit read denials. On Linux, binding the filesystem root writable can shadow standard devices, and additional root-metadata mounts can reopen denied symlink targets.
What changed
FileSystemSandboxPolicy::for_approved_commandto grant root and root-metadata writes while retaining path and glob denials. Keep the original policy when denials cannot be resolved or deny the root.Testing
Add regression coverage for approval policy materialization across Unix, Windows drive, and UNC paths; Windows volume expansion; Linux device access and metadata symlink restrictions; and capability serialization compatibility.