summaryrefslogtreecommitdiff
path: root/regress/forcecommand.sh
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2015-08-19 14:23:51 +0100
committerColin Watson <cjwatson@debian.org>2015-08-19 16:48:11 +0100
commit0f0841b2d28b7463267d4d91577e72e3340a1d3a (patch)
treeba55fcd2b6e2cc22b30f5afb561dbb3da4c8b6c7 /regress/forcecommand.sh
parentf2a5f5dae656759efb0b76c3d94890b65c197a02 (diff)
parent8698446b972003b63dfe5dcbdb86acfe986afb85 (diff)
New upstream release (6.8p1).
Diffstat (limited to 'regress/forcecommand.sh')
-rw-r--r--regress/forcecommand.sh26
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
4tid="forced command" 4tid="forced command"
5 5
6cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak 6cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak
7 7
8printf 'command="true" ' >$OBJ/authorized_keys_$USER 8cp /dev/null $OBJ/authorized_keys_$USER
9cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER 9for t in ${SSH_KEYTYPES}; do
10printf 'command="true" ' >>$OBJ/authorized_keys_$USER 10 printf 'command="true" ' >>$OBJ/authorized_keys_$USER
11cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER 11 cat $OBJ/$t.pub >> $OBJ/authorized_keys_$USER
12done
12 13
13for p in 1 2; do 14for 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"
17done 18done
18 19
19printf 'command="false" ' >$OBJ/authorized_keys_$USER 20cp /dev/null $OBJ/authorized_keys_$USER
20cat $OBJ/rsa.pub >> $OBJ/authorized_keys_$USER 21for t in ${SSH_KEYTYPES}; do
21printf 'command="false" ' >>$OBJ/authorized_keys_$USER 22 printf 'command="false" ' >> $OBJ/authorized_keys_$USER
22cat $OBJ/rsa1.pub >> $OBJ/authorized_keys_$USER 23 cat $OBJ/$t.pub >> $OBJ/authorized_keys_$USER
24done
23 25
24cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy 26cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy
25echo "ForceCommand true" >> $OBJ/sshd_proxy 27echo "ForceCommand true" >> $OBJ/sshd_proxy
26 28
27for p in 1 2; do 29for 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
35echo "Match User $USER" >> $OBJ/sshd_proxy 37echo "Match User $USER" >> $OBJ/sshd_proxy
36echo " ForceCommand true" >> $OBJ/sshd_proxy 38echo " ForceCommand true" >> $OBJ/sshd_proxy
37 39
38for p in 1 2; do 40for 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"