summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2020-04-03 07:53:10 +0000
committerDarren Tucker <dtucker@dtucker.net>2020-04-05 08:15:46 +1000
commite7e59a9cc8eb7fd5944ded28f4d7e3ae0a5fdecd (patch)
treebeb3e6e9d1aa51c85101983661baf50b90473c19 /regress
parentabe2b245b3ac6c4801e99bc0f13289cd28211e22 (diff)
upstream: Compute hash locally and re-enable %C tests.
OpenBSD-Regress-ID: 94d1366e8105274858b88a1f9ad2e62801e49770
Diffstat (limited to 'regress')
-rw-r--r--regress/percent.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/regress/percent.sh b/regress/percent.sh
index d39286d46..ef37ab22c 100644
--- a/regress/percent.sh
+++ b/regress/percent.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: percent.sh,v 1.3 2020/04/03 05:43:11 dtucker Exp $ 1# $OpenBSD: percent.sh,v 1.4 2020/04/03 07:53:10 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="percent expansions" 4tid="percent expansions"
@@ -39,23 +39,23 @@ trial()
39 esac 39 esac
40 if [ "$got" != "$expect" ]; then 40 if [ "$got" != "$expect" ]; then
41 fail "$opt=$arg expect $expect got $got" 41 fail "$opt=$arg expect $expect got $got"
42 else
43 trace "$opt=$arg expect $expect got $got"
44 fi 42 fi
45} 43}
46 44
47for i in matchexec localcommand remotecommand controlpath identityagent \ 45for i in matchexec localcommand remotecommand controlpath identityagent \
48 forwardagent; do 46 forwardagent; do
47 verbose $tid $i
49 if [ "$i" = "localcommand" ]; then 48 if [ "$i" = "localcommand" ]; then
50 HASH=94237ca18fe6b187dccf57e5593c0bb0a29cc302
51 REMUSER=$USER 49 REMUSER=$USER
52 trial $i '%T' NONE 50 trial $i '%T' NONE
53 else 51 else
54 HASH=dbc43d45c7f8c0ecd0a65c0da484c03b6903622e
55 REMUSER=remuser 52 REMUSER=remuser
56 fi 53 fi
54 # Matches implementation in readconf.c:ssh_connection_hash()
55 HASH=`printf "${HOSTNAME}127.0.0.1${PORT}$REMUSER" |
56 openssl sha1 | cut -f2 -d' '`
57 trial $i '%%' '%' 57 trial $i '%%' '%'
58 #trial $i '%C' $HASH 58 trial $i '%C' $HASH
59 trial $i '%i' $USERID 59 trial $i '%i' $USERID
60 trial $i '%h' 127.0.0.1 60 trial $i '%h' 127.0.0.1
61 trial $i '%d' $HOME 61 trial $i '%d' $HOME
@@ -65,8 +65,8 @@ for i in matchexec localcommand remotecommand controlpath identityagent \
65 trial $i '%p' $PORT 65 trial $i '%p' $PORT
66 trial $i '%r' $REMUSER 66 trial $i '%r' $REMUSER
67 trial $i '%u' $USER 67 trial $i '%u' $USER
68 trial $i '%%/%i/%h/%d/%L/%l/%n/%p/%r/%u' \ 68 trial $i '%%/%C/%i/%h/%d/%L/%l/%n/%p/%r/%u' \
69 "%/$USERID/127.0.0.1/$HOME/$HOST/$HOSTNAME/somehost/$PORT/$REMUSER/$USER" 69 "%/$HASH/$USERID/127.0.0.1/$HOME/$HOST/$HOSTNAME/somehost/$PORT/$REMUSER/$USER"
70done 70done
71 71
72# A subset of options support tilde expansion 72# A subset of options support tilde expansion