summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-12-06 23:05:52 +1100
committerDarren Tucker <dtucker@zip.com.au>2004-12-06 23:05:52 +1100
commit71b5643598d301a1a03c4845ff0eb159998a5fcf (patch)
tree3b9cbb7da698d3570d65fbc94086d44a27dd563d
parent3206e57e935870eb9a00a8aef3f3f1e70295b88d (diff)
- djm@cvs.openbsd.org 2004/10/08 02:01:50
[reexec.sh] shrink and tidy; ok dtucker@
-rw-r--r--ChangeLog5
-rw-r--r--regress/reexec.sh71
2 files changed, 32 insertions, 44 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ac3b4330..34a8e81fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,9 @@
32 - david@cvs.openbsd.org 2004/07/09 19:45:43 32 - david@cvs.openbsd.org 2004/07/09 19:45:43
33 [Makefile] 33 [Makefile]
34 add a missing CLEANFILES used in the re-exec test 34 add a missing CLEANFILES used in the re-exec test
35 - djm@cvs.openbsd.org 2004/10/08 02:01:50
36 [reexec.sh]
37 shrink and tidy; ok dtucker@
35 38
3620041203 3920041203
37 - (dtucker) OpenBSD CVS Sync 40 - (dtucker) OpenBSD CVS Sync
@@ -1905,4 +1908,4 @@
1905 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 1908 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
1906 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 1909 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
1907 1910
1908$Id: ChangeLog,v 1.3593 2004/12/06 12:04:57 dtucker Exp $ 1911$Id: ChangeLog,v 1.3594 2004/12/06 12:05:52 dtucker Exp $
diff --git a/regress/reexec.sh b/regress/reexec.sh
index ce3dd86a7..d69b8c577 100644
--- a/regress/reexec.sh
+++ b/regress/reexec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: reexec.sh,v 1.4 2004/06/26 06:16:07 djm Exp $ 1# $OpenBSD: reexec.sh,v 1.5 2004/10/08 02:01:50 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="reexec tests" 4tid="reexec tests"
@@ -9,33 +9,37 @@ SSHD_ORIG=$SSHD
9SSHD_COPY=$OBJ/sshd 9SSHD_COPY=$OBJ/sshd
10 10
11# Start a sshd and then delete it 11# Start a sshd and then delete it
12start_sshd_copy_zap () 12start_sshd_copy ()
13{ 13{
14 cp $SSHD_ORIG $SSHD_COPY 14 cp $SSHD_ORIG $SSHD_COPY
15 SSHD=$SSHD_COPY 15 SSHD=$SSHD_COPY
16 start_sshd 16 start_sshd
17 rm -f $SSHD_COPY
18 SSHD=$SSHD_ORIG 17 SSHD=$SSHD_ORIG
19} 18}
20 19
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
21verbose "test config passing" 36verbose "test config passing"
22cp $OBJ/sshd_config $OBJ/sshd_config.orig
23 37
38cp $OBJ/sshd_config $OBJ/sshd_config.orig
24start_sshd 39start_sshd
25
26echo "InvalidXXX=no" >> $OBJ/sshd_config 40echo "InvalidXXX=no" >> $OBJ/sshd_config
27 41
28rm -f ${COPY} 42copy_tests
29for p in 1 2; do
30 verbose "$tid: proto $p"
31 ${SSH} -nqo "Protocol=$p" -F $OBJ/ssh_config somehost \
32 cat ${DATA} > ${COPY}
33 if [ $? -ne 0 ]; then
34 fail "ssh cat $DATA failed"
35 fi
36 cmp ${DATA} ${COPY} || fail "corrupted copy"
37 rm -f ${COPY}
38done
39 43
40$SUDO kill `cat $PIDFILE` 44$SUDO kill `cat $PIDFILE`
41rm -f $PIDFILE 45rm -f $PIDFILE
@@ -44,19 +48,10 @@ cp $OBJ/sshd_config.orig $OBJ/sshd_config
44 48
45verbose "test reexec fallback" 49verbose "test reexec fallback"
46 50
47start_sshd_copy_zap 51start_sshd_copy
48 52rm -f $SSHD_COPY
49rm -f ${COPY} 53
50for p in 1 2; do 54copy_tests
51 verbose "$tid: proto $p"
52 ${SSH} -nqo "Protocol=$p" -F $OBJ/ssh_config somehost \
53 cat ${DATA} > ${COPY}
54 if [ $? -ne 0 ]; then
55 fail "ssh cat $DATA failed"
56 fi
57 cmp ${DATA} ${COPY} || fail "corrupted copy"
58 rm -f ${COPY}
59done
60 55
61$SUDO kill `cat $PIDFILE` 56$SUDO kill `cat $PIDFILE`
62rm -f $PIDFILE 57rm -f $PIDFILE
@@ -66,22 +61,12 @@ verbose "test reexec fallback without privsep"
66cp $OBJ/sshd_config.orig $OBJ/sshd_config 61cp $OBJ/sshd_config.orig $OBJ/sshd_config
67echo "UsePrivilegeSeparation=no" >> $OBJ/sshd_config 62echo "UsePrivilegeSeparation=no" >> $OBJ/sshd_config
68 63
69start_sshd_copy_zap 64start_sshd_copy
70 65rm -f $SSHD_COPY
71rm -f ${COPY} 66
72for p in 1 2; do 67copy_tests
73 verbose "$tid: proto $p"
74 ${SSH} -nqo "Protocol=$p" -F $OBJ/ssh_config somehost \
75 cat ${DATA} > ${COPY}
76 if [ $? -ne 0 ]; then
77 fail "ssh cat $DATA failed"
78 fi
79 cmp ${DATA} ${COPY} || fail "corrupted copy"
80 rm -f ${COPY}
81done
82 68
83$SUDO kill `cat $PIDFILE` 69$SUDO kill `cat $PIDFILE`
84rm -f $PIDFILE 70rm -f $PIDFILE
85 71
86cp $OBJ/sshd_config.orig $OBJ/sshd_config
87 72