From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9669B158042 for ; Thu, 17 Oct 2024 16:11:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 79C04E0965; Thu, 17 Oct 2024 16:11:27 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3A611E0858 for ; Thu, 17 Oct 2024 16:11:27 +0000 (UTC) From: =?UTF-8?q?Ulrich=20M=C3=BCller?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Ulrich=20M=C3=BCller?= Subject: [gentoo-dev] [PATCH v2 3/4] cvs.eclass: New eclass variable ECVS_SSH_EXTRA_OPTS Date: Thu, 17 Oct 2024 18:10:39 +0200 Message-ID: <20241017161110.26785-1-ulm@gentoo.org> X-Mailer: git-send-email 2.47.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: e71a3755-a5dc-4122-979f-e00384d4a3a0 X-Archives-Hash: 717579cee05d5b2e795310ab43fb21a7 This allows passing additional options to ssh. Signed-off-by: Ulrich Müller --- v2: Quote the options in the wrapper script eclass/cvs.eclass | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass index 1289ee54cc3b..007240e6ba25 100644 --- a/eclass/cvs.eclass +++ b/eclass/cvs.eclass @@ -174,6 +174,12 @@ _CVS_ECLASS=1 # WARNING: If a SSH host key is not specified using this variable, the # remote host key will not be verified. +# @ECLASS_VARIABLE: ECVS_SSH_EXTRA_OPTS +# @DEFAULT_UNSET +# @DESCRIPTION: +# If SSH is used for "ext" authentication, this array variable can be +# used to pass additional options to the SSH command. + # @ECLASS_VARIABLE: ECVS_CLEAN # @DEFAULT_UNSET # @DESCRIPTION: @@ -376,6 +382,11 @@ cvs_fetch() { echo "${ECVS_SSH_HOST_KEY}" > "${known_hosts_file}" || die fi + local i quoted_opts=() + for i in "${!ECVS_SSH_EXTRA_OPTS[@]}"; do + printf -v "quoted_opts[i]" "%q" "${ECVS_SSH_EXTRA_OPTS[i]}" + done + # Create a wrapper script to pass additional options to SSH # Disable X11 forwarding which causes .xauth access violations @@ -387,6 +398,7 @@ cvs_fetch() { -oUserKnownHostsFile="${known_hosts_file}" \\ -oForwardX11=no \\ -oClearAllForwardings=yes \\ + ${quoted_opts[*]} \\ "\$@" EOF chmod a+x "${CVS_RSH}" || die -- 2.47.0