You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warn about unmatched Bubblewrap resolver mounts - #1441
This PR adds a conditional Bubblewrap hint when the host /etc/resolv.conf
symlink names an absolute target with no overlapping known mount destination.
It reads the link but does not stat or canonicalize the target or policy
paths; the hint does not assert that DNS is unavailable or change execution.
Part of #507; #1442 covers the cwd hint. Neither PR alone closes#507.
This avoids the independent namespace preflight attempted in #1160.
Details
Compare baseline, virtual, and policy mount paths by components so
unrelated policy grants can still receive an actionable hint.
Defer relative and ambiguous paths; symlink aliases and missing files
can make an absolute-target hint inapplicable.
Cover resolver-link shapes and mount-argument parity without touching
host /etc or changing sandbox mounts.
Gudge (MGudgin)
changed the title
feat(bwrap): warn on clearly hidden resolver symlink targets
Warn about hidden Bubblewrap resolver targets
Oct 7, 2026
/tmp and /var/run are not host-content mounts. --tmpfs /tmp creates an empty filesystem, and --symlink /run /var/run only redirects lookup; neither makes a host resolver file such as canonical /tmp/resolv.conf or /var/run/custom/resolv.conf available. Treating these destinations as overlap therefore suppresses the advisory for targets that are clearly hidden, contrary to the PR's stated behavior (the new test even incorrectly classifies /tmp/resolv.conf as covered). Count only mounts that expose the target's host contents, and handle /var/run by checking the corresponding /run target against actual bind mounts rather than considering the whole subtree covered.
Correct test expectation for hidden files under tmpfs
This expectation encodes the same incorrect assumption: Bubblewrap's --tmpfs /tmp is empty and does not expose the host file /tmp/resolv.conf. This case should assert that the target is hidden so the regression test exercises the promised diagnostic.
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
This PR adds a conditional mount hint when the host /etc/resolv.conf
symlink names an absolute target with no overlapping known destination.
It reads the link but does not canonicalize or stat target and policy
paths; the hint does not assert that DNS is unavailable.
Details
* Compare baseline, virtual, and policy mounts by path components.
* Defer relative and ambiguous spellings without changing sandbox mounts.
* Test direct and uncertain link shapes with temporary files outside /etc.
* Check emitted mount destinations with default and non-default policies.
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: 52 passed.
* Linux-target mxc-sdk all-target check and Clippy: passed.
* Native Linux Bubblewrap tests 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
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
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 the host
/etc/resolv.confsymlink names an absolute target with no overlapping known mount destination.
It reads the link but does not stat or canonicalize the target or policy
paths; the hint does not assert that DNS is unavailable or change execution.
Part of #507; #1442 covers the cwd hint. Neither PR alone closes #507.
This avoids the independent namespace preflight attempted in #1160.
Details
unrelated policy grants can still receive an actionable hint.
can make an absolute-target hint inapplicable.
host
/etcor changing sandbox mounts.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: 52 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.execution hung. Earlier WSL runs used the pre-change tree.
Microsoft Reviewers: Open in CodeFlow