diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-04-30 23:34:55 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-05-01 11:59:42 +1000 |
commit | dd369320d2435b630a5974ab270d686dcd92d024 (patch) | |
tree | 97ae4bb34d835fbafad12180862195a9e9192d28 /regress/forcecommand.sh | |
parent | 557f921aad004be15805e09fd9572969eb3d9321 (diff) |
upstream commit
eliminate explicit specification of protocol in tests and
loops over protocol. We only support SSHv2 now.
Upstream-Regress-ID: 0082838a9b8a382b7ee9cbf0c1b9db727784fadd
Diffstat (limited to 'regress/forcecommand.sh')
-rw-r--r-- | regress/forcecommand.sh | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/regress/forcecommand.sh b/regress/forcecommand.sh index 8a9b090ea..e059f1fdb 100644 --- a/regress/forcecommand.sh +++ b/regress/forcecommand.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: forcecommand.sh,v 1.3 2015/03/03 22:35:19 markus Exp $ | 1 | # $OpenBSD: forcecommand.sh,v 1.4 2017/04/30 23:34:55 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="forced command" | 4 | tid="forced command" |
@@ -11,11 +11,8 @@ for t in ${SSH_KEYTYPES}; do | |||
11 | cat $OBJ/$t.pub >> $OBJ/authorized_keys_$USER | 11 | cat $OBJ/$t.pub >> $OBJ/authorized_keys_$USER |
12 | done | 12 | done |
13 | 13 | ||
14 | for p in ${SSH_PROTOCOLS}; do | 14 | trace "forced command in key option" |
15 | trace "forced command in key option proto $p" | 15 | ${SSH} -F $OBJ/ssh_proxy somehost false || fail "forced command in key" |
16 | ${SSH} -$p -F $OBJ/ssh_proxy somehost false \ || | ||
17 | fail "forced command in key proto $p" | ||
18 | done | ||
19 | 16 | ||
20 | cp /dev/null $OBJ/authorized_keys_$USER | 17 | cp /dev/null $OBJ/authorized_keys_$USER |
21 | for t in ${SSH_KEYTYPES}; do | 18 | for t in ${SSH_KEYTYPES}; do |
@@ -26,19 +23,13 @@ done | |||
26 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy | 23 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy |
27 | echo "ForceCommand true" >> $OBJ/sshd_proxy | 24 | echo "ForceCommand true" >> $OBJ/sshd_proxy |
28 | 25 | ||
29 | for p in ${SSH_PROTOCOLS}; do | 26 | trace "forced command in sshd_config overrides key option" |
30 | trace "forced command in sshd_config overrides key option proto $p" | 27 | ${SSH} -F $OBJ/ssh_proxy somehost false || fail "forced command in key" |
31 | ${SSH} -$p -F $OBJ/ssh_proxy somehost false \ || | ||
32 | fail "forced command in key proto $p" | ||
33 | done | ||
34 | 28 | ||
35 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy | 29 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy |
36 | echo "ForceCommand false" >> $OBJ/sshd_proxy | 30 | echo "ForceCommand false" >> $OBJ/sshd_proxy |
37 | echo "Match User $USER" >> $OBJ/sshd_proxy | 31 | echo "Match User $USER" >> $OBJ/sshd_proxy |
38 | echo " ForceCommand true" >> $OBJ/sshd_proxy | 32 | echo " ForceCommand true" >> $OBJ/sshd_proxy |
39 | 33 | ||
40 | for p in ${SSH_PROTOCOLS}; do | 34 | trace "forced command with match" |
41 | trace "forced command with match proto $p" | 35 | ${SSH} -F $OBJ/ssh_proxy somehost false || fail "forced command in key" |
42 | ${SSH} -$p -F $OBJ/ssh_proxy somehost false \ || | ||
43 | fail "forced command in key proto $p" | ||
44 | done | ||