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

Re: [PATCH v2] ssh: add 'ssh.keyfile' option

From
Matthias Aßhauer <mha1993@live.de>
Date
Apr 24, 2020, 04:33 UTC
Message-ID
<AM0PR04MB4771FB8BCD1EEB7E60EF54C7A5D00@AM0PR04MB4771.eurprd04.prod.outlook.com>
In-Reply-To
<xmqqeesegfgy.fsf@gitster.c.googlers.com>
Am 23.04.2020 um 21:38 schrieb Junio C Hamano:
Show 25 quoted lines
> My reading of the code tells me that it is *not* the case.  When the
> caller asks to connect only over IPv4 with CONNECT_IPV4 bit set in
> the flags, we cannot translate that to an option to underlying SSH
> implementation without knowing the variant.  As long as the caller
> does not specify IPV4/IPV6 or custom port, I think it is OK for the
> caller to leave the variant AUTO.
>
> So you probably want a patch along the lines of...
>
>   connect.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/connect.c b/connect.c
> index b6451ab5e8..b02cf74c9a 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -1118,7 +1118,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,
>   	if (flags & CONNECT_IPV4) {
>   		switch (variant) {
>   		case VARIANT_AUTO:
> -			BUG("VARIANT_AUTO passed to push_ssh_options");
> +			BUG("VARIANT_AUTO and CONNECT_IPV4 used together");
>   		case VARIANT_SIMPLE:
>   			die(_("ssh variant 'simple' does not support -4"));
>   		case VARIANT_SSH:

Yes, that looks about right. I'll extend the patch to also cover CONNECT_IPV6 and a custom port, give it a run through the test suite and send it back with a commit message. Thanks for taking a look at the legitimate cases where VARIANT_AUTO gets passed to push_ssh_options.

Previous: Junio C HamanoNext: Matthias Aßhauer
Message 8 of 9 in “ssh: add 'ssh.keyfile' option”
  1. ssh: add 'ssh.keyfile' optionRaymond E. Pasco, Apr 23, 2020
  2. ssh: add 'ssh.keyfile' optionRaymond E. Pasco, Apr 23, 2020
  3. Johannes SixtApr 23, 2020
  4. Junio C HamanoApr 23, 2020
  5. Raymond E. PascoApr 24, 2020
  6. Matthias AßhauerApr 23, 2020
  7. Junio C HamanoApr 23, 2020
  8. Matthias AßhauerApr 24, 2020
  9. connect.c: clarify BUG() messages in push_ssh_optionsMatthias Aßhauer, Apr 25, 2020

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.