mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
upstream: Add percent_expand test for 'Match Exec'.
OpenBSD-Regress-ID: a41c14fd6a0b54d66aa1e9eebfb9ec962b41232f
This commit is contained in:
parent
de34a44027
commit
92115ea7c3
@ -1,4 +1,4 @@
|
|||||||
# $OpenBSD: percent.sh,v 1.1 2020/04/03 02:33:31 dtucker Exp $
|
# $OpenBSD: percent.sh,v 1.2 2020/04/03 03:14:03 dtucker Exp $
|
||||||
# Placed in the Public Domain.
|
# Placed in the Public Domain.
|
||||||
|
|
||||||
tid="percent expansions"
|
tid="percent expansions"
|
||||||
@ -19,14 +19,24 @@ trial()
|
|||||||
opt="$1"; arg="$2"; expect="$3"
|
opt="$1"; arg="$2"; expect="$3"
|
||||||
|
|
||||||
trace "test $opt=$arg $expect"
|
trace "test $opt=$arg $expect"
|
||||||
if [ "$opt" = "localcommand" ]; then
|
rm -f $OBJ/actual
|
||||||
|
case "$opt" in
|
||||||
|
localcommand)
|
||||||
${SSH} -F $OBJ/ssh_proxy -o $opt="echo '$arg' >$OBJ/actual" \
|
${SSH} -F $OBJ/ssh_proxy -o $opt="echo '$arg' >$OBJ/actual" \
|
||||||
somehost true
|
somehost true
|
||||||
got=`cat $OBJ/actual`
|
got=`cat $OBJ/actual`
|
||||||
else
|
;;
|
||||||
|
matchexec)
|
||||||
|
(cat $OBJ/ssh_proxy && \
|
||||||
|
echo "Match Exec \"echo '$arg' >$OBJ/actual\"") \
|
||||||
|
>$OBJ/ssh_proxy_match
|
||||||
|
${SSH} -F $OBJ/ssh_proxy_match remuser@somehost true || true
|
||||||
|
got=`cat $OBJ/actual`
|
||||||
|
;;
|
||||||
|
*)
|
||||||
got=`${SSH} -F $OBJ/ssh_proxy -o $opt="$arg" -G \
|
got=`${SSH} -F $OBJ/ssh_proxy -o $opt="$arg" -G \
|
||||||
remuser@somehost | awk '$1=="'$opt'"{print $2}'`
|
remuser@somehost | awk '$1=="'$opt'"{print $2}'`
|
||||||
fi
|
esac
|
||||||
if [ "$got" != "$expect" ]; then
|
if [ "$got" != "$expect" ]; then
|
||||||
fail "$opt=$arg expect $expect got $got"
|
fail "$opt=$arg expect $expect got $got"
|
||||||
else
|
else
|
||||||
@ -34,7 +44,8 @@ trial()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
for i in localcommand remotecommand controlpath identityagent forwardagent; do
|
for i in matchexec localcommand remotecommand controlpath identityagent \
|
||||||
|
forwardagent; do
|
||||||
if [ "$i" = "localcommand" ]; then
|
if [ "$i" = "localcommand" ]; then
|
||||||
HASH=94237ca18fe6b187dccf57e5593c0bb0a29cc302
|
HASH=94237ca18fe6b187dccf57e5593c0bb0a29cc302
|
||||||
REMUSER=$USER
|
REMUSER=$USER
|
||||||
|
Loading…
x
Reference in New Issue
Block a user