Re: [PATCH v2] t5564: use a short path for the SOCKS proxy socket
- From
Jeff King <peff@peff.net>
- Date
- May 1, 2026, 06:47 UTC
- Message-ID
- <20260501064746.GC2038915@coredump.intra.peff.net>
- In-Reply-To
- <pull.2100.v2.git.1777450974159.gitgitgadget@gmail.com>
On Wed, Apr 29, 2026 at 08:22:54AM +0000, Johannes Schindelin via GitGitGadget wrote:
Show 19 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de> > > The SOCKS proxy test introduced in 0ca365c2ed4 (http: do not ignore > proxy path, 2024-08-02) creates a Unix domain socket in > `$TRASH_DIRECTORY`. When the trash directory path is long (e.g. > when running from a deeply nested worktree), the socket path can > exceed the 108-character limit for `struct sockaddr_un.sun_path` on > Linux, causing the test to fail with "Path length ... is longer > than maximum supported length (108)". > > We cannot work around this using the chdir trick our own socket code > employs, because both sides of the connection are outside our control: > the socket is created by socks4-proxy.pl via Perl's IO::Socket::UNIX, > and the client side is libcurl. > > Use `mktemp -d` to create a unique temporary directory with a short > path, and place the socket inside it. This avoids collisions between > concurrent test runs (e.g. `--stress`) and tmpdir-race vulnerabilities > that a static `/tmp` path would be susceptible to.
Thanks, this looks great to me (and thank you for fleshing out the explanation in the commit message, too).
-Peff