diff options
author | Colin Watson <cjwatson@debian.org> | 2015-08-19 14:23:51 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2015-08-19 16:48:11 +0100 |
commit | 0f0841b2d28b7463267d4d91577e72e3340a1d3a (patch) | |
tree | ba55fcd2b6e2cc22b30f5afb561dbb3da4c8b6c7 /regress/forcecommand.sh | |
parent | f2a5f5dae656759efb0b76c3d94890b65c197a02 (diff) | |
parent | 8698446b972003b63dfe5dcbdb86acfe986afb85 (diff) |
New upstream release (6.8p1).
Diffstat (limited to 'regress/forcecommand.sh')
-rw-r--r-- | regress/forcecommand.sh | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/regress/forcecommand.sh b/regress/forcecommand.sh index 44d2b7ffd..8a9b090ea 100644 --- a/regress/forcecommand.sh +++ b/regress/forcecommand.sh | |||
@@ -1,30 +1,32 @@ | |||
1 | # $OpenBSD: forcecommand.sh,v 1.2 2013/05/17 00:37:40 dtucker Exp $ | 1 | # $OpenBSD: forcecommand.sh,v 1.3 2015/03/03 22:35:19 markus Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="forced command" | 4 | tid="forced command" |
5 | 5 | ||
6 | cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak | 6 | cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak |
7 | 7 | ||
8 | printf 'command="true" ' >$OBJ/authorized_keys_$USER | 8 | cp /dev/null $OBJ/authorized_keys_$USER |
9 | cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER | 9 | for t in ${SSH_KEYTYPES}; do |
10 | printf 'command="true" ' >>$OBJ/authorized_keys_$USER | 10 | printf 'command="true" ' >>$OBJ/authorized_keys_$USER |
11 | cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER | 11 | cat $OBJ/$t.pub >> $OBJ/authorized_keys_$USER |
12 | done | ||
12 | 13 | ||
13 | for p in 1 2; do | 14 | for p in ${SSH_PROTOCOLS}; do |
14 | trace "forced command in key option proto $p" | 15 | trace "forced command in key option proto $p" |
15 | ${SSH} -$p -F $OBJ/ssh_proxy somehost false \ || | 16 | ${SSH} -$p -F $OBJ/ssh_proxy somehost false \ || |
16 | fail "forced command in key proto $p" | 17 | fail "forced command in key proto $p" |
17 | done | 18 | done |
18 | 19 | ||
19 | printf 'command="false" ' >$OBJ/authorized_keys_$USER | 20 | cp /dev/null $OBJ/authorized_keys_$USER |
20 | cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER | 21 | for t in ${SSH_KEYTYPES}; do |
21 | printf 'command="false" ' >>$OBJ/authorized_keys_$USER | 22 | printf 'command="false" ' >> $OBJ/authorized_keys_$USER |
22 | cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER | 23 | cat $OBJ/$t.pub >> $OBJ/authorized_keys_$USER |
24 | done | ||
23 | 25 | ||
24 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy | 26 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy |
25 | echo "ForceCommand true" >> $OBJ/sshd_proxy | 27 | echo "ForceCommand true" >> $OBJ/sshd_proxy |
26 | 28 | ||
27 | for p in 1 2; do | 29 | for p in ${SSH_PROTOCOLS}; do |
28 | trace "forced command in sshd_config overrides key option proto $p" | 30 | trace "forced command in sshd_config overrides key option proto $p" |
29 | ${SSH} -$p -F $OBJ/ssh_proxy somehost false \ || | 31 | ${SSH} -$p -F $OBJ/ssh_proxy somehost false \ || |
30 | fail "forced command in key proto $p" | 32 | fail "forced command in key proto $p" |
@@ -35,7 +37,7 @@ echo "ForceCommand false" >> $OBJ/sshd_proxy | |||
35 | echo "Match User $USER" >> $OBJ/sshd_proxy | 37 | echo "Match User $USER" >> $OBJ/sshd_proxy |
36 | echo " ForceCommand true" >> $OBJ/sshd_proxy | 38 | echo " ForceCommand true" >> $OBJ/sshd_proxy |
37 | 39 | ||
38 | for p in 1 2; do | 40 | for p in ${SSH_PROTOCOLS}; do |
39 | trace "forced command with match proto $p" | 41 | trace "forced command with match proto $p" |
40 | ${SSH} -$p -F $OBJ/ssh_proxy somehost false \ || | 42 | ${SSH} -$p -F $OBJ/ssh_proxy somehost false \ || |
41 | fail "forced command in key proto $p" | 43 | fail "forced command in key proto $p" |