[openssh-commits] [openssh] 02/02: upstream: Add test for proxycommand percent expansions.

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Oct 6 18:56:08 AEDT 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 1058092dba9145325a5f50793570fc754b375c3d
Author: dtucker at openbsd.org <dtucker at openbsd.org>
AuthorDate: Sat Oct 3 05:08:49 2026 +0000

    upstream: Add test for proxycommand percent expansions.
    
    OpenBSD-Regress-ID: be34cb5cf08f1025413df248cb7a65e18ca3e2a1
---
 regress/percent.sh | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/regress/percent.sh b/regress/percent.sh
index e32a77f0a..1d8480d58 100644
--- a/regress/percent.sh
+++ b/regress/percent.sh
@@ -1,4 +1,4 @@
-#	$OpenBSD: percent.sh,v 1.23 2026/04/02 07:52:15 djm Exp $
+#	$OpenBSD: percent.sh,v 1.24 2026/10/03 05:08:49 dtucker Exp $
 #	Placed in the Public Domain.
 
 tid="percent expansions"
@@ -29,6 +29,22 @@ trial()
 		    somehost true
 		got=`cat $OBJ/actual`
 		;;
+	proxycommand)
+		case "$arg" in
+		*(%C|%i|%L|%l|%u|%d)*)
+			# Not supported, skip
+			got="$expect"
+			;;
+		*)
+			# extract original proxycommand
+			pc=`${SSH} -F $OBJ/ssh_proxy -G somehost | \
+			    awk '$1=="proxycommand"' | sed 's/proxycommand //'`
+			${SSH} -o"proxycommand sh -c 'echo $arg >$OBJ/actual;$pc'" \
+			    -F $OBJ/ssh_proxy somehost true
+			got=`cat $OBJ/actual`
+			;;
+		esac
+		;;
 	user|user-l|user-at)
 		if [ "$arg" = '%r' ] || [ "$arg" = '%C' ]; then
 			# User does not support %r, ie itself or %C.  Skip test.
@@ -89,12 +105,12 @@ trial()
 	fi
 }
 
-for i in matchexec localcommand remotecommand controlpath identityagent \
-    forwardagent localforward remoteforward revokedhostkeys \
+for i in matchexec localcommand proxycommand remotecommand controlpath \
+    identityagent forwardagent localforward remoteforward revokedhostkeys \
     user setenv userknownhostsfile; do
 	verbose $tid $i percent
 	case "$i" in
-	localcommand|userknownhostsfile)
+	localcommand|proxycommand|userknownhostsfile)
 		# Any test that's going to actually make a connection needs
 		# to use the real username.
 		REMUSER=$USER ;;

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list