From patchwork Fri Apr 30 14:55:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Randall S. Becker" X-Patchwork-Id: 12233591 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2225C433B4 for ; Fri, 30 Apr 2021 14:56:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A250A61400 for ; Fri, 30 Apr 2021 14:56:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbhD3O4s (ORCPT ); Fri, 30 Apr 2021 10:56:48 -0400 Received: from elephants.elehost.com ([216.66.27.132]:40899 "EHLO elephants.elehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbhD3O4r (ORCPT ); Fri, 30 Apr 2021 10:56:47 -0400 X-Virus-Scanned: amavisd-new at elehost.com Received: from gnash (cpe00fc8d49d843-cm00fc8d49d840.cpe.net.cable.rogers.com [173.33.197.34]) (authenticated bits=0) by elephants.elehost.com (8.15.2/8.15.2) with ESMTPSA id 13UEttUk089431 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 30 Apr 2021 10:55:57 -0400 (EDT) (envelope-from rsbecker@nexbridge.com) From: "Randall S. Becker" To: Subject: [Patch 1/3] connect.c: add nonstopssh variant to the sshVariant set. Date: Fri, 30 Apr 2021 10:55:56 -0400 Message-ID: <011f01d73dd0$ecf91e00$c6eb5a00$@nexbridge.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: en-ca Thread-Index: Adc90KEqOMyQZxLPSF6mxwToAoF6Iw== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From ba4beb8ed0dff67ae6b95692d346adce346e2871 Mon Sep 17 00:00:00 2001 From: "Randall S. Becker" 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 --- connect.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.29.2 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. */ From patchwork Fri Apr 30 14:56:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Randall S. Becker" X-Patchwork-Id: 12233593 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79D61C433B4 for ; Fri, 30 Apr 2021 14:56:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 44F8561400 for ; Fri, 30 Apr 2021 14:56:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbhD3O5A (ORCPT ); Fri, 30 Apr 2021 10:57:00 -0400 Received: from elephants.elehost.com ([216.66.27.132]:40914 "EHLO elephants.elehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbhD3O47 (ORCPT ); Fri, 30 Apr 2021 10:56:59 -0400 X-Virus-Scanned: amavisd-new at elehost.com Received: from gnash (cpe00fc8d49d843-cm00fc8d49d840.cpe.net.cable.rogers.com [173.33.197.34]) (authenticated bits=0) by elephants.elehost.com (8.15.2/8.15.2) with ESMTPSA id 13UEu92w089450 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 30 Apr 2021 10:56:09 -0400 (EDT) (envelope-from rsbecker@nexbridge.com) From: "Randall S. Becker" To: Subject: [Patch 2/3] ssh.txt: document nonstopssh variant Date: Fri, 30 Apr 2021 10:56:03 -0400 Message-ID: <012001d73dd0$f42423a0$dc6c6ae0$@nexbridge.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: en-ca Thread-Index: Adc90PCCfrDYsgcmQhWnYABFlj20lw== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From 29158698900b312b20bfe46354d04898bf4eec04 Mon Sep 17 00:00:00 2001 From: "Randall S. Becker" Date: Fri, 30 Apr 2021 10:07:49 -0400 Subject: [Patch 2/3] ssh.txt: document nonstopssh variant The documentation changes describe the new nonstopssh variant and environment variables supporting the construction of the SSH command on the NonStop x86 and ia64 platforms. Signed-off-by: Randall S. Becker --- Documentation/config/ssh.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) -- 2.29.2 diff --git a/Documentation/config/ssh.txt b/Documentation/config/ssh.txt index 2ca4bf93e1..75f5cc3a0e 100644 --- a/Documentation/config/ssh.txt +++ b/Documentation/config/ssh.txt @@ -11,7 +11,8 @@ ssh.variant:: + The config variable `ssh.variant` can be set to override this detection. Valid values are `ssh` (to use OpenSSH options), `plink`, `putty`, -`tortoiseplink`, `simple` (no options except the host and remote command). +`tortoiseplink`, `simple` (no options except the host and remote command), +`nonstopssh`. The default auto-detection can be explicitly requested using the value `auto`. Any other value is treated as `ssh`. This setting can also be overridden via the environment variable `GIT_SSH_VARIANT`. @@ -29,7 +30,22 @@ follows: * `tortoiseplink` - [-P port] [-4] [-6] -batch [username@]host command +* `nonstopssh` - [-p port] [-Z] [-Q] [-S ssh-process] [username@]host command + -- + Except for the `simple` variant, command-line parameters are likely to change as git gains new features. + +The `nonstopssh` variant is controlled using environment variables: ++ +-- + +* SSH2_PROCESS_NAME defines the ssh-process to use for communications. + +* SSH_SUPPRESS_BANNER, if present, inhibits the -Z option. + +* SSH_SUPPRESS_QUIET, if present, inhibits the -Q option. +-- ++ +Consult the NonStop SSH manual for details on NonStop SSH options. From patchwork Fri Apr 30 14:56:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Randall S. Becker" X-Patchwork-Id: 12233595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C165CC433B4 for ; Fri, 30 Apr 2021 14:56:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92FA461405 for ; Fri, 30 Apr 2021 14:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbhD3O5H (ORCPT ); Fri, 30 Apr 2021 10:57:07 -0400 Received: from elephants.elehost.com ([216.66.27.132]:40920 "EHLO elephants.elehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbhD3O5E (ORCPT ); Fri, 30 Apr 2021 10:57:04 -0400 X-Virus-Scanned: amavisd-new at elehost.com Received: from gnash (cpe00fc8d49d843-cm00fc8d49d840.cpe.net.cable.rogers.com [173.33.197.34]) (authenticated bits=0) by elephants.elehost.com (8.15.2/8.15.2) with ESMTPSA id 13UEu92x089450 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 30 Apr 2021 10:56:11 -0400 (EDT) (envelope-from rsbecker@nexbridge.com) From: "Randall S. Becker" To: Subject: [Patch 3/3] t5601: add nonstopssh SSH variant sub-tests Date: Fri, 30 Apr 2021 10:56:10 -0400 Message-ID: <012101d73dd0$f4fc0d10$def42730$@nexbridge.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: en-ca Thread-Index: Adc90OARSV9oUEwuQEWWeCpm1cr5Vg== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From 375278eb010a91f0ad3114ca2334cd85c4519208 Mon Sep 17 00:00:00 2001 From: "Randall S. Becker" Date: Fri, 30 Apr 2021 10:10:28 -0400 Subject: [Patch 3/3] t5601: add nonstopssh SSH variant sub-tests Tests added are creation of the base configuration for nonstopssh with defaults, banner suppression, verbosity suppression, and explicit specification of the platform's SSH2 process name (for example $ZSSH0). Signed-off-by: Randall S. Becker --- t/t5601-clone.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) -- 2.29.2 diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index e7e6c08955..39b49ef67e 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -474,6 +474,40 @@ test_expect_success 'GIT_SSH_VARIANT overrides plink to tortoiseplink' ' expect_ssh "-batch -P 123" myhost src ' +test_expect_success 'nonstopssh base configuration' ' + copy_ssh_wrapper_as "$TRASH_DIRECTORY/nonstopssh" && + unset SSH2_PROCESS_NAME && + GIT_SSH_VARIANT=nonstopssh \ + git clone "[myhost:123]:src" ssh-bracket-clone-nonstopssh && + expect_ssh "-p 123 -Z -Q" myhost src +' + +test_expect_success 'nonstopssh suppress banner' ' + copy_ssh_wrapper_as "$TRASH_DIRECTORY/nonstopssh" && + unset SSH2_PROCESS_NAME && + GIT_SSH_VARIANT=nonstopssh \ + SSH_SUPPRESS_BANNER=1 \ + git clone "[myhost:123]:src" ssh-bracket-clone-nonstopssh2 && + expect_ssh "-p 123 -Q" myhost src +' + +test_expect_success 'nonstopssh suppress quiet' ' + copy_ssh_wrapper_as "$TRASH_DIRECTORY/nonstopssh" && + unset SSH2_PROCESS_NAME && + GIT_SSH_VARIANT=nonstopssh \ + SSH_SUPPRESS_QUIET=1 \ + git clone "[myhost:123]:src" ssh-bracket-clone-nonstopssh3 && + expect_ssh "-p 123 -Z" myhost src +' + +test_expect_success 'nonstopssh supply SSH process name' ' + copy_ssh_wrapper_as "$TRASH_DIRECTORY/nonstopssh" && + GIT_SSH_VARIANT=nonstopssh \ + SSH2_PROCESS_NAME=\$ZSSH0 \ + git clone "[myhost:123]:src" ssh-bracket-clone-nonstopssh4 && + expect_ssh "-p 123 -Z -Q -S \$ZSSH0" myhost src +' + test_expect_success 'clean failure on broken quoting' ' test_must_fail \ env GIT_SSH_COMMAND="${SQ}plink.exe -v" \