~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to regress/test-exec.sh

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-09-30 23:09:58 UTC
  • mfrom: (1.13.3 upstream) (29 hardy)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20080930230958-o6vsgn8c4mm959s0
Tags: 1:5.1p1-3
* Remove unnecessary ssh-vulnkey output in non-verbose mode when no
  compromised or unknown keys were found (closes: #496495).
* Configure with --disable-strip; dh_strip will deal with stripping
  binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link;
  closes: #498681).
* Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
  #497026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#       $OpenBSD: test-exec.sh,v 1.28 2005/05/20 23:14:15 djm Exp $
 
1
#       $OpenBSD: test-exec.sh,v 1.35 2008/06/28 13:57:25 djm Exp $
2
2
#       Placed in the Public Domain.
3
3
 
4
4
#SUDO=sudo
69
69
SFTPSERVER=/usr/libexec/openssh/sftp-server
70
70
SCP=scp
71
71
 
 
72
# Interop testing
 
73
PLINK=plink
 
74
PUTTYGEN=puttygen
 
75
CONCH=conch
 
76
 
72
77
if [ "x$TEST_SSH_SSH" != "x" ]; then
73
78
        SSH="${TEST_SSH_SSH}"
74
79
fi
96
101
if [ "x$TEST_SSH_SCP" != "x" ]; then
97
102
        SCP="${TEST_SSH_SCP}"
98
103
fi
 
104
if [ "x$TEST_SSH_PLINK" != "x" ]; then
 
105
        # Find real binary, if it exists
 
106
        case "${TEST_SSH_PLINK}" in
 
107
        /*) PLINK="${TEST_SSH_PLINK}" ;;
 
108
        *) PLINK=`which ${TEST_SSH_PLINK} 2>/dev/null` ;;
 
109
        esac
 
110
fi
 
111
if [ "x$TEST_SSH_PUTTYGEN" != "x" ]; then
 
112
        # Find real binary, if it exists
 
113
        case "${TEST_SSH_PUTTYGEN}" in
 
114
        /*) PUTTYGEN="${TEST_SSH_PUTTYGEN}" ;;
 
115
        *) PUTTYGEN=`which ${TEST_SSH_PUTTYGEN} 2>/dev/null` ;;
 
116
        esac
 
117
fi
 
118
if [ "x$TEST_SSH_CONCH" != "x" ]; then
 
119
        # Find real binary, if it exists
 
120
        case "${TEST_SSH_CONCH}" in
 
121
        /*) CONCH="${TEST_SSH_CONCH}" ;;
 
122
        *) CONCH=`which ${TEST_SSH_CONCH} 2>/dev/null` ;;
 
123
        esac
 
124
fi
99
125
 
100
126
# Path to sshd must be absolute for rexec
101
127
case "$SSHD" in
269
295
done
270
296
chmod 644 $OBJ/authorized_keys_$USER
271
297
 
 
298
# Activate Twisted Conch tests if the binary is present
 
299
REGRESS_INTEROP_CONCH=no
 
300
if test -x "$CONCH" ; then
 
301
        REGRESS_INTEROP_CONCH=yes
 
302
fi
 
303
 
 
304
# If PuTTY is present and we are running a PuTTY test, prepare keys and
 
305
# configuration
 
306
REGRESS_INTEROP_PUTTY=no
 
307
if test -x "$PUTTYGEN" -a -x "$PLINK" ; then
 
308
        REGRESS_INTEROP_PUTTY=yes
 
309
fi
 
310
case "$SCRIPT" in
 
311
*putty*)        ;;
 
312
*)              REGRESS_INTEROP_PUTTY=no ;;
 
313
esac
 
314
 
 
315
if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then
 
316
        mkdir -p ${OBJ}/.putty
 
317
 
 
318
        # Add a PuTTY key to authorized_keys
 
319
        rm -f ${OBJ}/putty.rsa2
 
320
        puttygen -t rsa -o ${OBJ}/putty.rsa2 < /dev/null > /dev/null
 
321
        puttygen -O public-openssh ${OBJ}/putty.rsa2 \
 
322
            >> $OBJ/authorized_keys_$USER
 
323
 
 
324
        # Convert rsa2 host key to PuTTY format
 
325
        ${SRC}/ssh2putty.sh 127.0.0.1 $PORT $OBJ/rsa > \
 
326
            ${OBJ}/.putty/sshhostkeys
 
327
        ${SRC}/ssh2putty.sh 127.0.0.1 22 $OBJ/rsa >> \
 
328
            ${OBJ}/.putty/sshhostkeys
 
329
 
 
330
        # Setup proxied session
 
331
        mkdir -p ${OBJ}/.putty/sessions
 
332
        rm -f ${OBJ}/.putty/sessions/localhost_proxy
 
333
        echo "Hostname=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy
 
334
        echo "PortNumber=$PORT" >> ${OBJ}/.putty/sessions/localhost_proxy
 
335
        echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy
 
336
        echo "ProxyTelnetCommand=sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy 
 
337
 
 
338
        REGRESS_INTEROP_PUTTY=yes
 
339
fi
 
340
 
272
341
# create a proxy version of the client config
273
342
(
274
343
        cat $OBJ/ssh_config
281
350
start_sshd ()
282
351
{
283
352
        # start sshd
284
 
        $SUDO ${SSHD} -f $OBJ/sshd_config -t    || fatal "sshd_config broken"
285
 
        $SUDO ${SSHD} -f $OBJ/sshd_config -e >>$TEST_SSH_LOGFILE 2>&1
 
353
        $SUDO ${SSHD} -f $OBJ/sshd_config "$@" -t || fatal "sshd_config broken"
 
354
        $SUDO ${SSHD} -f $OBJ/sshd_config -e "$@" >>$TEST_SSH_LOGFILE 2>&1
286
355
 
287
356
        trace "wait for sshd"
288
357
        i=0;