diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2006-12-13 08:36:37 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2006-12-13 08:36:37 +0000 |
commit | da87bbf460a3f2080e4fb1d7eef16f38e66e94e3 (patch) | |
tree | 40dc64ba82cef33fcddfc2bb3275ddf096fbceb6 /regress | |
parent | 5fc0a3f218b71d69f1913cb2243b9d1474231103 (diff) |
Additional test for multiple PermitOpen entries. ok djm@
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.bin/ssh/cfgmatch.sh | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/cfgmatch.sh b/regress/usr.bin/ssh/cfgmatch.sh index e6840f877bc..2819b4f62b4 100644 --- a/regress/usr.bin/ssh/cfgmatch.sh +++ b/regress/usr.bin/ssh/cfgmatch.sh @@ -1,4 +1,4 @@ -# $OpenBSD: cfgmatch.sh,v 1.3 2006/11/06 09:27:43 markus Exp $ +# $OpenBSD: cfgmatch.sh,v 1.4 2006/12/13 08:36:36 dtucker Exp $ # Placed in the Public Domain. tid="sshd_config match" @@ -103,3 +103,22 @@ for p in 1 2; do fail "match override permitopen proto $p" stop_client done + +cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy +echo "PermitOpen 127.0.0.1:1 127.0.0.1:$PORT 127.0.0.2:2" >>$OBJ/sshd_proxy +echo "Match User NoSuchUser" >>$OBJ/sshd_proxy +echo "PermitOpen 127.0.0.1:1 127.0.0.1:2" >>$OBJ/sshd_proxy + +# Test that a rule that doesn't match doesn't override, plus test a +# PermitOpen entry that's not at the start of the list +for p in 1 2; do + rm -f $pidfile + trace "nomatch permitopen proxy w/key opts proto $p" + ${SSH} -q -$p $fwd -F $OBJ/ssh_proxy -f somehost \ + exec sh -c \'"echo \$\$ > $pidfile; exec sleep 100"\' >>$TEST_SSH_LOGFILE 2>&1 ||\ + fail "nomatch override permitopen proto $p sshd failed" + sleep 1; + ${SSH} -q -$p -p $fwdport -F $OBJ/ssh_config somehost true || \ + fail "nomatch override permitopen proto $p" + stop_client +done |