Skip to content

Commit 4d87a00

Browse files
committed
upstream: Instead of skipping the all-tokens test if we don't have
OpenSSL (since we use it to compute the hash), put the hash at the end and just omit it if we don't have it. Prompted by bz#3521. OpenBSD-Regress-ID: c79ecba64250ed3b6417294b6c965e6b12ca5eea
1 parent b05406d commit 4d87a00

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

regress/percent.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $OpenBSD: percent.sh,v 1.15 2023/01/06 12:33:33 dtucker Exp $
1+
# $OpenBSD: percent.sh,v 1.16 2023/01/14 09:57:08 dtucker Exp $
22
# Placed in the Public Domain.
33

44
tid="percent expansions"
@@ -12,6 +12,7 @@ USER=`id -u -n`
1212
USERID=`id -u`
1313
HOST=`hostname | cut -f1 -d.`
1414
HOSTNAME=`hostname`
15+
HASH=""
1516

1617
# Localcommand is evaluated after connection because %T is not available
1718
# until then. Because of this we use a different method of exercising it,
@@ -98,10 +99,13 @@ for i in matchexec localcommand remotecommand controlpath identityagent \
9899
# containing %d for UserKnownHostsFile
99100
if [ "$i" != "userknownhostsfile" ]; then
100101
trial $i '%d' $HOME
102+
in='%%/%i/%h/%d/%L/%l/%n/%p/%r/%u'
103+
out="%/$USERID/127.0.0.1/$HOME/$HOST/$HOSTNAME/somehost/$PORT/$REMUSER/$USER"
101104
if [ ! -z "${HASH}" ]; then
102-
trial $i '%%/%C/%i/%h/%d/%L/%l/%n/%p/%r/%u' \
103-
"%/$HASH/$USERID/127.0.0.1/$HOME/$HOST/$HOSTNAME/somehost/$PORT/$REMUSER/$USER"
105+
in="$in/%C"
106+
out="$out/$HASH"
104107
fi
108+
trial $i "$in" "$out"
105109
fi
106110
done
107111

0 commit comments

Comments
 (0)