diff options
Diffstat (limited to 'regress/cfgmatch.sh')
-rw-r--r-- | regress/cfgmatch.sh | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/regress/cfgmatch.sh b/regress/cfgmatch.sh index 0603fab64..80cf22930 100644 --- a/regress/cfgmatch.sh +++ b/regress/cfgmatch.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: cfgmatch.sh,v 1.6 2011/06/03 05:35:10 dtucker Exp $ | 1 | # $OpenBSD: cfgmatch.sh,v 1.8 2013/05/17 00:37:40 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="sshd_config match" | 4 | tid="sshd_config match" |
@@ -15,7 +15,7 @@ start_client() | |||
15 | rm -f $pidfile | 15 | rm -f $pidfile |
16 | ${SSH} -q -$p $fwd "$@" somehost \ | 16 | ${SSH} -q -$p $fwd "$@" somehost \ |
17 | exec sh -c \'"echo \$\$ > $pidfile; exec sleep 100"\' \ | 17 | exec sh -c \'"echo \$\$ > $pidfile; exec sleep 100"\' \ |
18 | >>$TEST_SSH_LOGFILE 2>&1 & | 18 | >>$TEST_REGRESS_LOGFILE 2>&1 & |
19 | client_pid=$! | 19 | client_pid=$! |
20 | # Wait for remote end | 20 | # Wait for remote end |
21 | n=0 | 21 | n=0 |
@@ -34,21 +34,20 @@ stop_client() | |||
34 | pid=`cat $pidfile` | 34 | pid=`cat $pidfile` |
35 | if [ ! -z "$pid" ]; then | 35 | if [ ! -z "$pid" ]; then |
36 | kill $pid | 36 | kill $pid |
37 | sleep 1 | ||
38 | fi | 37 | fi |
39 | wait | 38 | wait |
40 | } | 39 | } |
41 | 40 | ||
42 | cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak | 41 | cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak |
43 | grep -v AuthorizedKeysFile $OBJ/sshd_proxy_bak > $OBJ/sshd_proxy | ||
44 | echo "AuthorizedKeysFile /dev/null" >>$OBJ/sshd_proxy | ||
45 | echo "PermitOpen 127.0.0.1:1" >>$OBJ/sshd_config | 42 | echo "PermitOpen 127.0.0.1:1" >>$OBJ/sshd_config |
46 | echo "Match user $USER" >>$OBJ/sshd_proxy | ||
47 | echo "AuthorizedKeysFile /dev/null $OBJ/authorized_keys_%u" >>$OBJ/sshd_proxy | ||
48 | echo "Match Address 127.0.0.1" >>$OBJ/sshd_config | 43 | echo "Match Address 127.0.0.1" >>$OBJ/sshd_config |
49 | echo "PermitOpen 127.0.0.1:$PORT" >>$OBJ/sshd_config | 44 | echo "PermitOpen 127.0.0.1:$PORT" >>$OBJ/sshd_config |
50 | 45 | ||
46 | grep -v AuthorizedKeysFile $OBJ/sshd_proxy_bak > $OBJ/sshd_proxy | ||
47 | echo "AuthorizedKeysFile /dev/null" >>$OBJ/sshd_proxy | ||
51 | echo "PermitOpen 127.0.0.1:1" >>$OBJ/sshd_proxy | 48 | echo "PermitOpen 127.0.0.1:1" >>$OBJ/sshd_proxy |
49 | echo "Match user $USER" >>$OBJ/sshd_proxy | ||
50 | echo "AuthorizedKeysFile /dev/null $OBJ/authorized_keys_%u" >>$OBJ/sshd_proxy | ||
52 | echo "Match Address 127.0.0.1" >>$OBJ/sshd_proxy | 51 | echo "Match Address 127.0.0.1" >>$OBJ/sshd_proxy |
53 | echo "PermitOpen 127.0.0.1:$PORT" >>$OBJ/sshd_proxy | 52 | echo "PermitOpen 127.0.0.1:$PORT" >>$OBJ/sshd_proxy |
54 | 53 | ||
@@ -75,9 +74,9 @@ for p in 1 2; do | |||
75 | done | 74 | done |
76 | 75 | ||
77 | # Retry previous with key option, should also be denied. | 76 | # Retry previous with key option, should also be denied. |
78 | echon 'permitopen="127.0.0.1:'$PORT'" ' >$OBJ/authorized_keys_$USER | 77 | printf 'permitopen="127.0.0.1:'$PORT'" ' >$OBJ/authorized_keys_$USER |
79 | cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER | 78 | cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER |
80 | echon 'permitopen="127.0.0.1:'$PORT'" ' >>$OBJ/authorized_keys_$USER | 79 | printf 'permitopen="127.0.0.1:'$PORT'" ' >>$OBJ/authorized_keys_$USER |
81 | cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER | 80 | cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER |
82 | for p in 1 2; do | 81 | for p in 1 2; do |
83 | trace "match permitopen proxy w/key opts proto $p" | 82 | trace "match permitopen proxy w/key opts proto $p" |