Commit bb09b69
committed
fix(native-sidecar): use one universal resolve-beneath walk for host-mount confinement
Replace the Linux openat2(RESOLVE_BENEATH) path and the separate macOS
cap-std fallback with a single portable resolve-beneath walker. gVisor/runsc
(Rivet Compute) does not support openat2(RESOLVE_BENEATH), so a guest
chdir/stat into a host mount returned ENOENT under runsc while passing under
runc. The walker descends one component at a time with plain openat(2)
(O_NOFOLLOW), keeps its own ancestor-fd stack for .., expands symlinks
manually, and rejects absolute components/targets as escapes.
- Delete src/macos_fs.rs and drop the cap-std dependency
- Move the universal resolver into plugins/host_dir.rs as the confine module
- Point filesystem.rs at crate::plugins::host_dir::confine
- Document why openat2 is not used across the affected modules and AGENTS.md1 parent d9179cc commit bb09b69
13 files changed
Lines changed: 635 additions & 750 deletions
File tree
- crates
- native-sidecar
- src
- plugins
- tests
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11099 | 11099 | | |
11100 | 11100 | | |
11101 | 11101 | | |
11102 | | - | |
| 11102 | + | |
11103 | 11103 | | |
11104 | 11104 | | |
11105 | 11105 | | |
| |||
0 commit comments