summaryrefslogtreecommitdiff
path: root/regress/cfgmatch.sh
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2007-10-26 14:45:13 +1000
committerDamien Miller <djm@mindrot.org>2007-10-26 14:45:13 +1000
commit80ba1300e248d914512f579a9bfac1193f7ec746 (patch)
tree02dbf31f3bf20ffd4f0e527cc7835fd7df4e0775 /regress/cfgmatch.sh
parent99ad35352a03463a2a56557d6f3979bf13284162 (diff)
- dtucker@cvs.openbsd.org 2006/12/13 08:36:36
[regress/cfgmatch.sh] Additional test for multiple PermitOpen entries. ok djm@
Diffstat (limited to 'regress/cfgmatch.sh')
-rw-r--r--regress/cfgmatch.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/regress/cfgmatch.sh b/regress/cfgmatch.sh
index 46f26d08..35c5e52a 100644
--- a/regress/cfgmatch.sh
+++ b/regress/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"
@@ -104,3 +104,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