Subject: Re: t7528-signed-commit-ssh.sh fails due to ssh-agent fails to start with ENAMETOOLONG

From: "brian m. carlson" <[email-masked]>
Date: Fri, 17 Oct 2025 19:31:06 +0000

On 2025-10-17 at 10:54:00, Jeff King wrote:
> On Fri, Oct 17, 2025 at 06:52:49PM +0900, Lauri Tirkkonen wrote:
> 
> > > If I unset SSH_AUTH_SOCK in my environment, then the test consistently
> > > fails. But I'm somewhat amazed that nobody has complained about this
> > > before. Surely somebody somewhere (especially CI!) is running t7528
> > > without SSH_AUTH_SOCK set in the environment. Which makes wonder if I'm
> > > missing something.
> > 
> > I believe the issue surfaced only now because prior to OpenSSH 10.1,
> > ssh-agent would put its socket in /tmp by default, not under $HOME. See
> > https://www.openssh.com/txt/release-10.1
> 
> Ah, of course. That explains it perfectly, thanks. So we're going to get
> lots more reports as people upgrade. :)

I had not had time to properly analyze it in order to say something more
thoughtful than "this is broken", but I can confirm it breaks for me on
Debian unstable:

  ERROR: ld.so: object 'libc_malloc_debug.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
  ./t7528-signed-commit-ssh.sh: 1: eval: directory.t7528-signed-commit-ssh/.ssh/agent/s.5w4CQ2109U.agent.5l0ixCaX1S: not found
  Agent pid 1429798
  Could not add identity "/home/bmc/checkouts/git/t/trash directory.t7528-signed-commit-ssh/gpghome/ed25519_ssh_signing_key": agent refused operation

Note that OpenSSH in my case is broken because of the space in the
home directory.  I've reported that to Debian and we'll see if it gets
fixed.  (I did mention it breaks the Git testsuite in the hopes that
improves the likelihood of getting it fixed.)

> > We saw this failure in CI on Alpine Linux and worked around by adding -T
> > to the ssh-agent invocation in this test, but I suppose that won't work
> > for earlier releases of OpenSSH.
> 
> Yeah. We could either do something like "ssh-agent -T || ssh-agent", or
> we could go with "ssh-agent -a" (which has been around since 2002, but
> does raise the potential relative-path issue).

I think like `ssh-agent -T || ssh-agent` would be better because we know
$HOME can be very long in our case, whereas $TMPDIR should not be
excessive (since presumably it worked before and other services, such as
tmux, place their sockets there).
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA