Commit 5c2b87f
committed
fix(auto-reply): resolve scp via PATH instead of hardcoded /usr/bin/scp (#78677)
stageRemoteFileIntoRoot -> scpFile spawned /usr/bin/scp directly, which is POSIX-FHS-only and fails with ENOENT on Windows native (OpenSSH ships scp.exe outside /usr/bin), Homebrew/Nix prefixes, and any layout where scp lives elsewhere on PATH. Pass the bare command 'scp' so child_process.spawn resolves the OS-appropriate binary via PATH while keeping the existing BatchMode + StrictHostKeyChecking + '--' separator argv (no shell expansion, normalizeScpRemoteHost/normalizeScpRemotePath still guard host/path inputs, no widened attack surface). Adds a targeted regression test that asserts spawn is called with 'scp' (not '/usr/bin/scp') so a future revert reintroduces the cross-platform regression visibly.1 parent 8e17910 commit 5c2b87f
3 files changed
Lines changed: 39 additions & 1 deletion
File tree
- src/auto-reply
- reply
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
120 | 151 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
321 | 327 | | |
322 | | - | |
| 328 | + | |
323 | 329 | | |
324 | 330 | | |
325 | 331 | | |
| |||
0 commit comments