git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [Patch 1/3] connect.c: add nonstopssh variant to the sshVariant set.
@ 2021-04-30 14:55 Randall S. Becker
  2021-04-30 16:25 ` Elijah Newren
  0 siblings, 1 reply; 10+ messages in thread
From: Randall S. Becker @ 2021-04-30 14:55 UTC (permalink / raw)
  To: git

From ba4beb8ed0dff67ae6b95692d346adce346e2871 Mon Sep 17 00:00:00 2001
From: "Randall S. Becker" <rsbecker@nexbridge.com>
Date: Fri, 30 Apr 2021 09:56:09 -0400
Subject: [Patch 1/3] connect.c: add nonstopssh variant to the sshVariant set.

This enhancement allows the NonStop SSH subsystem to be supported by
git without the need of a wrapper script. The command arguments for
the platform SSH client in /G/system/zssh/sshoss are constructed based
on optional supplied environment variables SSH2_PROCESS_NAME (system
defined), SSH_SUPPRESS_QUIET, and SSH_SUPPRESS_BANNER.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
---
 connect.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/connect.c b/connect.c
index 40b5c15f81..34e9c4ac33 100644
--- a/connect.c
+++ b/connect.c
@@ -1091,6 +1091,7 @@ enum ssh_variant {
        VARIANT_PLINK,
        VARIANT_PUTTY,
        VARIANT_TORTOISEPLINK,
+       VARIANT_NONSTOPSSH,
 };

 static void override_ssh_variant(enum ssh_variant *ssh_variant)
@@ -1108,6 +1109,8 @@ static void override_ssh_variant(enum ssh_variant *ssh_variant)
                *ssh_variant = VARIANT_PUTTY;
        else if (!strcmp(variant, "tortoiseplink"))
                *ssh_variant = VARIANT_TORTOISEPLINK;
+       else if (!strcmp(variant, "nonstopssh"))
+               *ssh_variant = VARIANT_NONSTOPSSH;
        else if (!strcmp(variant, "simple"))
                *ssh_variant = VARIANT_SIMPLE;
        else
@@ -1156,6 +1159,8 @@ static enum ssh_variant determine_ssh_variant(const char *ssh_command,
        else if (!strcasecmp(variant, "tortoiseplink") ||
                 !strcasecmp(variant, "tortoiseplink.exe"))
                ssh_variant = VARIANT_TORTOISEPLINK;
+       else if (!strcasecmp(variant, "sshoss"))
+               ssh_variant = VARIANT_NONSTOPSSH;

        free(p);
        return ssh_variant;
@@ -1275,6 +1280,7 @@ static void push_ssh_options(struct strvec *args, struct strvec *env,
                case VARIANT_SIMPLE:
                        die(_("ssh variant 'simple' does not support setting port"));
                case VARIANT_SSH:
+               case VARIANT_NONSTOPSSH:
                        strvec_push(args, "-p");
                        break;
                case VARIANT_PLINK:
@@ -1285,6 +1291,17 @@ static void push_ssh_options(struct strvec *args, struct strvec *env,

                strvec_push(args, port);
        }
+
+       if (variant == VARIANT_NONSTOPSSH) {
+               if (!getenv("SSH_SUPPRESS_BANNER"))
+                       strvec_push(args, "-Z");
+               if (!getenv("SSH_SUPPRESS_QUIET"))
+                       strvec_push(args, "-Q");
+               if (getenv("SSH2_PROCESS_NAME")) {
+                       strvec_push(args, "-S");
+                       strvec_push(args, getenv("SSH2_PROCESS_NAME"));
+               }
+       }
 }

 /* Prepare a child_process for use by Git's SSH-tunneled transport. */
--
2.29.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-06-05 21:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30 14:55 [Patch 1/3] connect.c: add nonstopssh variant to the sshVariant set Randall S. Becker
2021-04-30 16:25 ` Elijah Newren
2021-04-30 16:38   ` Randall S. Becker
2021-04-30 17:17     ` Elijah Newren
2021-04-30 17:32       ` Randall S. Becker
2021-05-10 15:24         ` Randall S. Becker
2021-06-04 19:29           ` Randall S. Becker
2021-06-04 19:51             ` Junio C Hamano
2021-06-04 20:35               ` Randall S. Becker
2021-06-05 21:56               ` Randall S. Becker

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).