git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 17, 2025, 17:42 UTC
Message-ID
<xmqqbjm51l3a.fsf@gitster.g>
In-Reply-To
<20251017070912.GA4068463@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> AFAICT, ssh-agent does not quote the path in its output. So for example:
>
>   d='/tmp/has spaces'
>   mkdir "$d"
>   HOME=$d ssh-agent
>
> will produce:
>
>   SSH_AUTH_SOCK=/tmp/has spaces/.ssh/agent/s.IcPuGe26YY.agent.6PtD3uhM4O; export SSH_AUTH_SOCK;
>
> which is nonsense to eval.
So if $d were
    d='/tmp/has rm -rf in it'
would that produce some interesting side effect?
Show 15 quoted lines
> I expected that would cause ssh-add to fail, since our SSH_AUTH_SOCK
> would point to truncated garbage, and we can't talk to the agent. But it
> doesn't even do that. The extra space turns that line from a variable
> assignment into a one-shot variable attached to a command that fails to
> run. And so we're left with the original SSH_AUTH_SOCK from the
> environment, the one in my real $HOME outside of the trash directory.
> Yikes!
>
> 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.
>
> -Peff
Previous: Jeff KingNext: Jeff King
Message 8 of 9 in “t7528-signed-commit-ssh.sh fails due to ssh-agent fails to start with ENAMETOOLONG”
  1. Xi RuoyaoOct 17, 2025
  2. Collin FunkOct 17, 2025
  3. Jeff KingOct 17, 2025
  4. Lauri TirkkonenOct 17, 2025
  5. Jeff KingOct 17, 2025
  6. brian m. carlsonOct 17, 2025
  7. Jeff KingOct 18, 2025
  8. Junio C HamanoOct 17, 2025
  9. Jeff KingOct 18, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.