Repository navigation
Warn about unmatched Bubblewrap cwd mounts - #1442
Merged
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Raw string containment can incorrectly warn for equivalent mount paths containing repeated or trailing separators.
1 open finding
What changed in this PR
Adds conservative Bubblewrap warnings when an explicit working directory is clearly outside mounted paths.
Changes:
- Detects uncovered canonical working directories and retains warnings.
- Adds unit and CLI integration coverage.
- Documents warning behavior and remedies.
| File | Description |
|---|---|
bwrap_runner.rs |
Emits and tests retained cwd warnings. |
bwrap_command.rs |
Determines whether cwd overlaps known mounts. |
run_bwrap_cwd_advisory_test.sh |
Tests CLI warning and execution behavior. |
run_bwrap_all_tests.sh |
Registers the new integration test. |
bubblewrap-backend.md |
Documents the advisory. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Gudge (MGudgin)
force-pushed
the
user/gudge/mxc_507_cwd_advisory
branch
from
October 7, 2026 17:19
85daae0 to
a284d8a
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The advisory remains conservative, preserves Bubblewrap behavior, and has focused regression and integration coverage.
0 open findings
1 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Gudge (MGudgin)
force-pushed
the
user/gudge/mxc_507_cwd_advisory
branch
from
October 8, 2026 20:07
3201984 to
9f9f9dc
Compare
Soham Das (SohamDas2021)
previously approved these changes
Oct 8, 2026
This PR adds a conditional launch-time hint when an explicit absolute process.cwd has no overlapping known mount destination. It compares path spellings without canonicalizing host or policy paths, and leaves the actual --chdir result to Bubblewrap. Details * Compare baseline, virtual, and policy mount destinations by components. * Keep uncertain paths advisory-only and retain the hint for SDK callers and on lxc-exec stderr. * Cover unrelated and covering policy mounts without changing execution. Tests * From src/, cargo fmt --all -- --check: passed. * cargo check -p mxc-sdk --all-targets --quiet: passed. * cargo clippy -p mxc-sdk --all-targets --quiet -- -D warnings: passed. * cargo test -p mxc-sdk --lib bwrap_command --quiet: 53 passed. * Linux-target mxc-sdk all-target check and Clippy: passed. * Git Bash cwd shell test syntax check: passed. * Native Linux Bubblewrap test not run: WSL command execution hung. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6f448a40-019f-4bfd-82e0-ec6b7d23c4d8 Generated-with: gpt-6-sol
Gudge (MGudgin)
force-pushed
the
user/gudge/mxc_507_cwd_advisory
branch
from
October 9, 2026 03:26
9f9f9dc to
e38ce02
Compare
Soham Das (SohamDas2021)
self-requested a review
October 9, 2026 03:33
Soham Das (SohamDas2021)
approved these changes
Oct 9, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

This PR adds a conditional Bubblewrap hint when an explicit absolute
process.cwdhas no apparent overlapping mount destination. It comparespath spellings without inspecting the host cwd or policy paths, and leaves
the actual
--chdirresult and execution behavior to Bubblewrap.Part of #507; #1441 covers the resolver-target hint. Neither PR alone
closes #507. This remains advisory as recommended when #1160 was closed.
Details
unrelated policy grants do not suppress the hint.
make a hint inapplicable without changing mounts or rejecting a request.
test, including an unrelated policy mount and a covering mount.
Tests
src/,cargo fmt --all -- --check: passed.cargo check -p mxc-sdk --all-targets --quiet: passed.cargo clippy -p mxc-sdk --all-targets --quiet -- -D warnings: passed.cargo test -p mxc-sdk --lib bwrap_command --quiet: 56 passed on Windows.cargo check -p mxc-sdk --target x86_64-unknown-linux-gnu --all-targets --quiet: passed.cargo clippy -p mxc-sdk --target x86_64-unknown-linux-gnu --all-targets --quiet -- -D warnings: passed.C:\Program Files\Git\bin\bash.exe -n tests\scripts\run_bwrap_cwd_advisory_test.sh: passed.src/,CARGO_TARGET_DIR="$HOME/src/microsoft/mxc/mxc.root/src/target" cargo test -p mxc-sdk --lib bubblewrap::common --quiet -- --test-threads=1: 311 passed.CARGO_TARGET_DIR="$HOME/src/microsoft/mxc/mxc.root/src/target" cargo build -p lxc --quiet: passed.LXC_EXEC="$HOME/src/microsoft/mxc/mxc.root/src/target/debug/lxc-exec" bash ../tests/scripts/run_bwrap_cwd_advisory_test.sh: passed on the rebased tree, preserving both the cwd and resolver hints.Microsoft Reviewers: Open in CodeFlow