]> andersk Git - gssapi-openssh.git/blame - openssh/regress/reexec.sh
Import of OpenSSH 4.2p1
[gssapi-openssh.git] / openssh / regress / reexec.sh
CommitLineData
996d5e62 1# $OpenBSD: reexec.sh,v 1.5 2004/10/08 02:01:50 djm Exp $
c9f39d2c 2# Placed in the Public Domain.
3
4tid="reexec tests"
5
665a873d 6DATA=/bin/ls${EXEEXT}
c9f39d2c 7COPY=${OBJ}/copy
665a873d 8SSHD_ORIG=$SSHD${EXEEXT}
9SSHD_COPY=$OBJ/sshd${EXEEXT}
c9f39d2c 10
11# Start a sshd and then delete it
996d5e62 12start_sshd_copy ()
c9f39d2c 13{
14 cp $SSHD_ORIG $SSHD_COPY
15 SSHD=$SSHD_COPY
16 start_sshd
c9f39d2c 17 SSHD=$SSHD_ORIG
18}
19
996d5e62 20# Do basic copy tests
21copy_tests ()
22{
23 rm -f ${COPY}
24 for p in 1 2; do
25 verbose "$tid: proto $p"
26 ${SSH} -nqo "Protocol=$p" -F $OBJ/ssh_config somehost \
27 cat ${DATA} > ${COPY}
28 if [ $? -ne 0 ]; then
29 fail "ssh cat $DATA failed"
30 fi
31 cmp ${DATA} ${COPY} || fail "corrupted copy"
32 rm -f ${COPY}
33 done
34}
35
c9f39d2c 36verbose "test config passing"
c9f39d2c 37
996d5e62 38cp $OBJ/sshd_config $OBJ/sshd_config.orig
c9f39d2c 39start_sshd
c9f39d2c 40echo "InvalidXXX=no" >> $OBJ/sshd_config
41
996d5e62 42copy_tests
c9f39d2c 43
44$SUDO kill `cat $PIDFILE`
45rm -f $PIDFILE
46
47cp $OBJ/sshd_config.orig $OBJ/sshd_config
48
49verbose "test reexec fallback"
50
996d5e62 51start_sshd_copy
52rm -f $SSHD_COPY
53
54copy_tests
c9f39d2c 55
56$SUDO kill `cat $PIDFILE`
57rm -f $PIDFILE
58
59verbose "test reexec fallback without privsep"
60
61cp $OBJ/sshd_config.orig $OBJ/sshd_config
62echo "UsePrivilegeSeparation=no" >> $OBJ/sshd_config
63
996d5e62 64start_sshd_copy
65rm -f $SSHD_COPY
66
67copy_tests
c9f39d2c 68
69$SUDO kill `cat $PIDFILE`
70rm -f $PIDFILE
71
c9f39d2c 72
This page took 0.055232 seconds and 5 git commands to generate.