Repository navigation
Conversation
buildSandboxCommand quotes the socat binary and then interpolates the two UNIX-CONNECT addresses bare into a string the inner shell re-parses. The socket paths sit under tmpdir(), which is whatever TMPDIR says, so a space there splits an address into two words. socat is then handed a third address, refuses to start, and >/dev/null 2>&1 hides the message, leaving the command running against a relay that never bound.
This branch has not been deployed
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.
buildSandboxCommandquotes the socat binary and then interpolates the twoUNIX-CONNECTaddresses bare into a string that the inner<shell> -cre-parses:The socket paths come from
join(tmpdir(), ...), andtmpdir()is whateverTMPDIRsays. A space in it splits the address into two words, socat is handed a third address, refuses to start, and>/dev/null 2>&1swallows the message. The script carries on and the command runs against a relay that never bound, so the first proxied connection is refused with nothing in the logs to say why.A space in
TMPDIRis not exotic on a Mac but it happens on Linux too, throughTMPDIRpointing at a user-named directory, and the same goes for a path that holds a quote or a glob character.I mentioned this on #616 while that one was about the listener race, which #639 has since fixed. The quoting is separate and still there, so here is the change for it: the addresses go through the same
quotethe binary already uses.Tested with a socket directory named
srt test dir <pid>. Without the change the new test fails on the first assertion, with it the file is 20 pass, 22 skip.bun testover the whole suite gives the same 19 failures with and without the change, all of them--control-fdand proxy cases that need Linux or a network, andnpm run typecheck, prettier and eslint are clean.The test is gated on
isLinuxlike its neighbours, so it will only actually run on the Linux legs. I did check that it passes and fails as intended on this machine by removing the gate locally, sincewrapCommandWithSandboxLinuxbuilds the string without caring which platform it is on.