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

RE: [BUG] GIT_SSH_COMMAND is not being decomposed

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Apr 15, 2019, 22:34 UTC
Message-ID
<008101d4f3db$56c20410$04460c30$@nexbridge.com>
In-Reply-To
<87ef63ezt9.fsf@igel.home>
On April 15, 2019 17:14, Andreas Schwab wrote:
Show 11 quoted lines
> On Apr 15 2019, "Randall S. Becker" <rsbecker@nexbridge.com> wrote:
> 
> > on virtually any platform at my disposal (Windows, Ubuntu, MacOS, the
> > older NonStop variant), and have that work with no problem. Somewhere
> > after get_ssh_command(), the command is being interpreted it its parts
> > either as a shell or something else (still trying to find that).
> 
> See run-command.c:prepare_shell_cmd, if the command contains shell meta
> characters it is passed to sh -c without further quoting.
> 
> Andreas.
Well crap. That explains far too much about what is happening. 😊. One of the special parameters is specified as -S \$ZSSH2 (example, referring to the process name - which begin with $ and have to be escaped with \). This obviously triggers the alternate path and has been problematic. On the older systems, we found fewer (a.k.a just about none) uses of this parameter, so never encountered it. On the newer systems, virtually everyone is using -S. Ergo, behavioural differences. That explains a whole lot of why we need a wrapper script. Thanks for the pointer to the strcspn() reference. I can stop obsessing about this (thanks too Johannes, Szeder, Ævar) for the help.
As a suggestion, with people who know how to escape stuff properly (or not), perhaps we can select the alternate behaviour explicitly using a core.sshIgnoreEscape=true/false option. Thoughts on that?

Regards, Randall

Previous: Andreas SchwabNext: Junio C Hamano
Message 8 of 10 in “[BUG] GIT_SSH_COMMAND is not being decomposed”
  1. Randall S. BeckerApr 13, 2019
  2. Ævar Arnfjörð BjarmasonApr 13, 2019
  3. Randall S. BeckerApr 13, 2019
  4. SZEDER GáborApr 13, 2019
  5. Randall S. BeckerApr 14, 2019
  6. Randall S. BeckerApr 15, 2019
  7. Andreas SchwabApr 15, 2019
  8. Randall S. BeckerApr 15, 2019
  9. Junio C HamanoApr 16, 2019
  10. Johannes SixtApr 15, 2019

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.