Skip to contentSkip to conversation

Advise request on adding a new SSH variant

DISCUSSION Randall S. Becker 3 participants 6 messages Apr 26, 2021 – May 5, 2021

lore
Share & tools
lore
#0 lore raw

Hi Team,

I am getting a bunch of requests from my team (and customers) to make SSH configuration easier on the NonStop platform. We are currently using a wrapper script to drive the variant of SSH on the platform but that is not convenient for many people. I would like to add an ssh.Variant called "nonstopssh", or something like that, which takes a few extra parameters. -Q (quiet), -Z (don't display the banner), -p port (obvious but typically required), -S (a system process name). The code in connect.c looks pretty straight forward, but I'm wondering about the best way to pass in a process name (it would be something like "$ZSSHX" - usually an environment variable "SSH2_PROCESS_NAME"). The program name for SSH, I assume, could come from GIT_SSH_COMMAND (typically "/G/system/zssh/sshoss", or I could force it if not supplied). I'm also wondering about controls for the -Q and -Z parameters. Should I just use the environment for this and build up args or is there a more appropriate way of managing these values?

Thanks in advance,
Randall

-- Brief whoami:
NonStop developer since approximately 211288444200000000 UNIX developer since approximately 421664400
-- In my real life, I talk too much.

#1 lore raw

Hi Randall,
some drive-by comments..

Quoted 11 lines · Randall S. Becker

Hi Team,

I am getting a bunch of requests from my team (and customers) to make SSH configuration easier on the NonStop platform.
We are currently using a
wrapper script to drive the variant of SSH on the platform but that is not convenient for many people.
I would like to add an ssh.Variant called
"nonstopssh", or something like that, which takes a few extra parameters. -Q (quiet), -Z (don't display the banner), -p port (obvious but typically required), -S (a system process name).

https://git-scm.com/docs/git-config#Documentation/git-config.txt-sshvariant

Sounds sensible to me. Maybe also look at past issues that Git-for-Windows had with folks having too much prior choice (plink, putty, tortoiseplink). May need more clarity in the docs ;-)

Quoted 4 lines

The code in connect.c looks pretty
straight forward, but I'm wondering about the best way to pass in a process name (it would be something like "$ZSSHX" - usually an environment variable "SSH2_PROCESS_NAME").

Hopefully others can chime in.. Maybe see discussion at <[email protected]> about $ARG variable.

Quoted 3 lines

The program name for SSH, I assume, could come from GIT_SSH_COMMAND (typically "/G/system/zssh/sshoss", or I could force it if not supplied).

https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresshCommand

Quoted 6 lines

I'm also wondering about controls for the -Q and -Z parameters.
Should I just use the environment for this and build up args or is there a more appropriate way of managing these values?

Quoted 9 lines

Thanks in advance,
Randall

-- Brief whoami:
NonStop developer since approximately 211288444200000000 UNIX developer since approximately 421664400
-- In my real life, I talk too much.

I was also thinking that the lack of replies maybe links to the "Pain points in Git's patch flow" thread <[email protected]> whereby it's all about the proposed patch, rather than thoughts about a potential patch.
(Sort of like the philosophy of science [method] that ignores opinion, and demands evidence)

--
Philip

#2 lore raw
Quoted 1 line

From: <[email protected]>

Quoted 10 lines · Philip Oakley
Quoted 9 lines · Randall S. Becker

I am getting a bunch of requests from my team (and customers) to make SSH configuration easier on the NonStop platform.
We are currently using a
wrapper script to drive the variant of SSH on the platform but that is not convenient for many people.
I would like to add an ssh.Variant called "nonstopssh", or something like that, which takes a few extra parameters.
-Q (quiet), -Z (don't display the banner), -p port (obvious but typically required), -S (a system process name).

Quoted 5 lines

https://git-scm.com/docs/git-config#Documentation/git-config.txt-sshvariant

Sounds sensible to me. Maybe also look at past issues that Git-for-Windows had with folks having too much prior choice (plink, putty, tortoiseplink). May need more clarity in the docs ;-)

In this situation, NonStop SSH is pretty much the only real option for users. OpenSSH works and is an option, but the version is lagging a due to port difficulties and $DAYJOB. NonStop SSH is supplied by the OS vendor, so basically everyone uses it.

Quoted 4 lines
Quoted 4 lines

The code in connect.c looks pretty
straight forward, but I'm wondering about the best way to pass in a process name (it would be something like "$ZSSHX" - usually an environment variable "SSH2_PROCESS_NAME").

Quoted 10 lines

Hopefully others can chime in.. Maybe see discussion at <[email protected]> about $ARG variable.

Quoted 3 lines

The program name for SSH, I assume, could come from GIT_SSH_COMMAND (typically "/G/system/zssh/sshoss", or I could force it if not supplied).

https://git-scm.com/docs/git-config#Documentation/git-config.txt-
coresshCommand

Quoted 3 lines

I'm also wondering about controls for the -Q and -Z parameters. Should I just use the environment for this and build up args or is there a more appropriate way of managing these values?

The $ZSSHX form causes a shell started for GIT_SSH_COMMAND to have issues. Much cleaner to pass the value as a raw argument - rather the point of this variant. I'm trying to decide whether to put through V2, which removes controls for -Q and -Z, but I think it might be better to leave the patch as is. The $ prefix on process names goes back to 1978 (maybe before that in prototypes), and isn't going to change. I'm not sure the $ARG variable has any benefit here. The SSH2_PROCESS_NAME is going to be in the user's environment on that platform, so the default situation (just that variable), seems to do exactly what the end user needs. The other form of a process name is cluster node qualified, for example, \MYNODE.$ZSSHX, which makes things even worse in a shell because of the backslash *and* $. We otherwise end up with all sorts of junk in the end command, and errors with -S thinking the user name is a poorly formed process name.

-Randall

#3 lore raw
In reply to Philip Oakley
Quoted 6 lines · Philip Oakley

I was also thinking that the lack of replies maybe links to the "Pain points in Git's patch flow" thread <[email protected]> whereby it's all about the proposed patch, rather than thoughts about a potential patch.
(Sort of like the philosophy of science [method] that ignores opinion, and demands evidence)

Actually, the initial message on this matter from Randall came in the patch form <[email protected]>, so if it were truly "it's all about the proposed patch, rather than thoughts about a potential patch", it would have gained much more responses.

Other than I didn't have time, the reason I didn't respond was that the concept and notation used there were a bit too foreign to me to decide from where to start asking questions. It wasn't clear what '$ZSSHX' meant (is it the value of an environment variable whose name is ZSSHX, or is it literally a name with dollar in it and is the issue being addressed that it is too cumbersome to quote it properly in value of the GIT_SSH_COMMAND environment variable?) for example. And after reading the message you are responding to twice, I do not quite get what problem we are trying to solve. Especially since

No, it would be GIT_SSH_COMMAND='/G/system/zssh/sshoss -Z -Q -S $ZSSH0' and that does not work correctly in the current git code base.

in <[email protected]> sounded like we have a fairly clearly demonstratable problem (i.e. the handling of the command line given via GIT_SSH_COMMAND is somehow broken). The details of "does not work correctly in the current code base" is not yet disclosed but it sounded like it would be possible to tease it out and solve the issue in a more direct way. But yet the solution presented in the three-patch series looked like it was sidestepping the entire issue and adding a special case for NonStop without having to touch GIT_SSH_COMMAND at all (presumably leaving it still "broken").

#4 lore raw

Randall S. Becker, Managing Director, Nexbridge Inc. +1.416.984.9826

Quoted 9 lines

-----Original Message-----
From: Junio C Hamano <[email protected]>
Sent: May 4, 2021 8:49 PM
To: Philip Oakley <[email protected]>
Cc: Randall S. Becker <[email protected]>; [email protected]
Subject: Re: Advise request on adding a new SSH variant

Philip Oakley <[email protected]> writes:

Quoted 8 lines
Quoted 6 lines

I was also thinking that the lack of replies maybe links to the "Pain points in Git's patch flow" thread <[email protected]> whereby it's all about the proposed patch, rather than thoughts about a potential patch.
(Sort of like the philosophy of science [method] that ignores opinion, and demands evidence)

Actually, the initial message on this matter from Randall came in the patch

form

Quoted 2 lines

<[email protected]>, so if it were truly "it's all about the proposed patch, rather than thoughts about a potential

patch", it

Quoted 3 lines

would have gained much more responses.

Other than I didn't have time, the reason I didn't respond was that the

concept

Quoted 1 line

and notation used there were a bit too foreign to me to decide from where

to

Quoted 1 line

start asking questions. It wasn't clear what '$ZSSHX' meant (is it the

value of an

Quoted 1 line

environment variable whose name is ZSSHX, or is it literally a name with

dollar

Quoted 1 line

in it and is the issue being addressed that it is too cumbersome to quote

it

Quoted 2 lines

properly in value of the GIT_SSH_COMMAND environment variable?) for example. And after reading the message you are responding to twice, I do

not

Quoted 8 lines

quite get what problem we are trying to solve. Especially since

No, it would be GIT_SSH_COMMAND='/G/system/zssh/sshoss -Z -Q -S $ZSSH0' and that does not work correctly in the current git code base.

in <[email protected]> sounded like we have a fairly clearly demonstratable problem (i.e. the handling of the

command

Quoted 2 lines

line given via GIT_SSH_COMMAND is somehow broken). The details of "does not work correctly in the current code base" is not yet disclosed but it

sounded like it

Quoted 1 line

would be possible to tease it out and solve the issue in a more direct way.

But

Quoted 3 lines

yet the solution presented in the three-patch series looked like it was sidestepping the entire issue and adding a special case for NonStop without having to touch GIT_SSH_COMMAND at all (presumably leaving it still

"broken").

Were it not for the response in thread
https://public-inbox.org/git/[email protected],
I would take a 100% agreement position. But it sounded like the problem was platform-related so would not be fixed, thus the variant that avoids the issue.

By running a shell if GIT_SSH_COMMAND is not a simple path, with potentially multiple levels of escapes of the $ required, depending on the circumstances of how the command is run, I would agree completely. However, with a variant, as described in how the variant operates (from my interpretation), it seems like the approach of the patch is correct by avoiding shell variable resolution on an exotic platform rather than solving an otherwise situation that would not be likely to occur anywhere else.

The environment variable is named SSH2_PROCESS_NAME and contains a value starting with $ - making a shell interpret it if a shell is started. $ZSSH0 is a typical name used, but the value varies from system to system, except for the $ that is mandatory to designate the name of a process. There was no UNIX variant in 1978 when the platform was created, so that prefix character was chosen. It won't change in the foreseeable future, for the expected lifespan of the platform.

With all of the above, as long as there is a potential solution, I'm up for it, but let me know how you would like it to look and I'll try to make it work.

-Randall "who did not himself come up with the NonStop naming structure" and "who has no control over how NonStop SSH interprets anything whatsoever" Becker.

#5 lore raw
In reply to Junio C Hamano
Quoted 8 lines · Junio C Hamano
Quoted 6 lines · Philip Oakley

I was also thinking that the lack of replies maybe links to the "Pain points in Git's patch flow" thread <[email protected]> whereby it's all about the proposed patch, rather than thoughts about a potential patch.
(Sort of like the philosophy of science [method] that ignores opinion, and demands evidence)

Quoted 5 lines

Actually, the initial message on this matter from Randall came in the patch form <[email protected]>, so if it were truly "it's all about the proposed patch, rather than thoughts about a potential patch", it would have gained much more responses.

I'd missed the patches (at the time) as my mail client hadn't grouped them together, so that mail looked a bit lonely, hence my reply ;-) I saw a later note by Randall that send-email hadn't worked on his system which gave rise to the patches being 'spread about'.

Quoted 16 lines

Other than I didn't have time, the reason I didn't respond was that the concept and notation used there were a bit too foreign to me to decide from where to start asking questions. It wasn't clear what '$ZSSHX' meant (is it the value of an environment variable whose name is ZSSHX, or is it literally a name with dollar in it and is the issue being addressed that it is too cumbersome to quote it properly in value of the GIT_SSH_COMMAND environment variable?) for example. And after reading the message you are responding to twice, I do not quite get what problem we are trying to solve. Especially since

No, it would be GIT_SSH_COMMAND='/G/system/zssh/sshoss -Z -Q -S $ZSSH0' and that does not work correctly in the current git code base.

Quoted 10 lines

in <[email protected]> sounded like we have a fairly clearly demonstratable problem (i.e. the handling of the command line given via GIT_SSH_COMMAND is somehow broken). The details of "does not work correctly in the current code base" is not yet disclosed but it sounded like it would be possible to tease it out and solve the issue in a more direct way. But yet the solution presented in the three-patch series looked like it was sidestepping the entire issue and adding a special case for NonStop without having to touch GIT_SSH_COMMAND at all (presumably leaving it still "broken").

I didn't understand all that either. I'd just spotted the other ssh variants being common on Windows.. A classic curse of knowledge (or lack of it) problem.

Philip