diff options
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index 986d99287..70250acd7 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -1,9 +1,14 @@ | |||
1 | # $OpenBSD: test-exec.sh,v 1.15 2004/02/24 16:56:30 markus Exp $ | 1 | # $OpenBSD: test-exec.sh,v 1.23 2004/06/25 01:25:12 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | PORT=4242 | ||
5 | #SUDO=sudo | 4 | #SUDO=sudo |
6 | 5 | ||
6 | if [ ! -z "$TEST_SSH_PORT" ]; then | ||
7 | PORT="$TEST_SSH_PORT" | ||
8 | else | ||
9 | PORT=4242 | ||
10 | fi | ||
11 | |||
7 | if [ -x /usr/ucb/whoami ]; then | 12 | if [ -x /usr/ucb/whoami ]; then |
8 | USER=`/usr/ucb/whoami` | 13 | USER=`/usr/ucb/whoami` |
9 | elif whoami >/dev/null 2>&1; then | 14 | elif whoami >/dev/null 2>&1; then |
@@ -47,6 +52,7 @@ SSHKEYGEN=ssh-keygen | |||
47 | SSHKEYSCAN=ssh-keyscan | 52 | SSHKEYSCAN=ssh-keyscan |
48 | SFTP=sftp | 53 | SFTP=sftp |
49 | SFTPSERVER=/usr/libexec/openssh/sftp-server | 54 | SFTPSERVER=/usr/libexec/openssh/sftp-server |
55 | SCP=scp | ||
50 | 56 | ||
51 | if [ "x$TEST_SSH_SSH" != "x" ]; then | 57 | if [ "x$TEST_SSH_SSH" != "x" ]; then |
52 | SSH="${TEST_SSH_SSH}" | 58 | SSH="${TEST_SSH_SSH}" |
@@ -72,10 +78,16 @@ fi | |||
72 | if [ "x$TEST_SSH_SFTPSERVER" != "x" ]; then | 78 | if [ "x$TEST_SSH_SFTPSERVER" != "x" ]; then |
73 | SFTPSERVER="${TEST_SSH_SFTPSERVER}" | 79 | SFTPSERVER="${TEST_SSH_SFTPSERVER}" |
74 | fi | 80 | fi |
81 | if [ "x$TEST_SSH_SCP" != "x" ]; then | ||
82 | SCP="${TEST_SSH_SCP}" | ||
83 | fi | ||
84 | |||
85 | # Path to sshd must be absolute for rexec | ||
86 | SSHD=`which sshd` | ||
75 | 87 | ||
76 | # these should be used in tests | 88 | # these should be used in tests |
77 | export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER | 89 | export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP |
78 | #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER | 90 | #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER $SCP |
79 | 91 | ||
80 | # helper | 92 | # helper |
81 | echon() | 93 | echon() |
@@ -156,15 +168,23 @@ trap fatal 3 2 | |||
156 | 168 | ||
157 | # create server config | 169 | # create server config |
158 | cat << EOF > $OBJ/sshd_config | 170 | cat << EOF > $OBJ/sshd_config |
171 | StrictModes no | ||
159 | Port $PORT | 172 | Port $PORT |
160 | ListenAddress 127.0.0.1 | 173 | ListenAddress 127.0.0.1 |
161 | #ListenAddress ::1 | 174 | #ListenAddress ::1 |
162 | PidFile $PIDFILE | 175 | PidFile $PIDFILE |
163 | AuthorizedKeysFile $OBJ/authorized_keys_%u | 176 | AuthorizedKeysFile $OBJ/authorized_keys_%u |
164 | LogLevel QUIET | 177 | LogLevel QUIET |
165 | StrictModes no | 178 | AcceptEnv _XXX_TEST_* |
179 | AcceptEnv _XXX_TEST | ||
180 | Subsystem sftp $SFTPSERVER | ||
166 | EOF | 181 | EOF |
167 | 182 | ||
183 | if [ ! -z "$TEST_SSH_SSHD_CONFOPTS" ]; then | ||
184 | trace "adding sshd_config option $TEST_SSH_SSHD_CONFOPTS" | ||
185 | echo "$TEST_SSH_SSHD_CONFOPTS" >> $OBJ/sshd_config | ||
186 | fi | ||
187 | |||
168 | # server config for proxy connects | 188 | # server config for proxy connects |
169 | cp $OBJ/sshd_config $OBJ/sshd_proxy | 189 | cp $OBJ/sshd_config $OBJ/sshd_proxy |
170 | 190 | ||
@@ -190,6 +210,11 @@ Host * | |||
190 | StrictHostKeyChecking yes | 210 | StrictHostKeyChecking yes |
191 | EOF | 211 | EOF |
192 | 212 | ||
213 | if [ ! -z "$TEST_SSH_SSH_CONFOPTS" ]; then | ||
214 | trace "adding ssh_config option $TEST_SSH_SSHD_CONFOPTS" | ||
215 | echo "$TEST_SSH_SSH_CONFOPTS" >> $OBJ/ssh_config | ||
216 | fi | ||
217 | |||
193 | rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER | 218 | rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER |
194 | 219 | ||
195 | trace "generate keys" | 220 | trace "generate keys" |