Commit 2e154b3
authored
fix(terminal): stop proot "can't sanitize binding" fd warnings (#2878)
* fix(terminal): stop proot "can't sanitize binding" fd warnings
proot canonicalizes every -b host path with realpath(3). The /proc/self/fd/N magic links only resolve when the descriptor points to a real file, so piped stdio (what Acode's ProcessBuilder uses) made realpath(3) fail and proot drop the binding with `can't sanitize binding "/proc/self/fd/N"`.
The [ -e ] guard passed those links because stat(2) follows the magic link to the underlying pipe/socket inode, so it never filtered them out. Replace it with a can_bind helper that resolves the link target the way realpath(3) does, and narrow the LSP-side proot-warning filters to only this benign message so real proot warnings are no longer swallowed.
* fix(terminal): probe /proc/self/fd via shell pid in can_bind
readlink(1) runs as a child process, so for fd 2 its /proc/self/fd/2 is the /dev/null of the `2>/dev/null` redirect rather than the stderr proot inherits. That made can_bind treat a piped stderr as bindable, leaving one `can't sanitize binding "/proc/self/fd/2"` warning. Probe /proc/$$/fd/N instead; $$ survives the exec and names the process proot runs as.1 parent efae4a9 commit 2e154b3
3 files changed
Lines changed: 52 additions & 12 deletions
File tree
- src
- cm/lsp
- plugins/terminal/scripts
- settings
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
911 | 918 | | |
912 | 919 | | |
913 | 920 | | |
914 | | - | |
| 921 | + | |
915 | 922 | | |
916 | 923 | | |
917 | 924 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
73 | 105 | | |
74 | 106 | | |
75 | 107 | | |
76 | | - | |
| 108 | + | |
77 | 109 | | |
78 | 110 | | |
79 | 111 | | |
80 | | - | |
| 112 | + | |
81 | 113 | | |
82 | 114 | | |
83 | 115 | | |
84 | | - | |
| 116 | + | |
85 | 117 | | |
86 | 118 | | |
87 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
0 commit comments