summaryrefslogtreecommitdiff
path: root/regress/scp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/scp.sh')
-rw-r--r--regress/scp.sh25
1 files changed, 19 insertions, 6 deletions
diff --git a/regress/scp.sh b/regress/scp.sh
index 703cc0893..c3034b6e7 100644
--- a/regress/scp.sh
+++ b/regress/scp.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: scp.sh,v 1.2 2004/06/16 13:15:09 dtucker Exp $ 1# $OpenBSD: scp.sh,v 1.3 2004/07/08 12:59:35 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="scp" 4tid="scp"
@@ -12,16 +12,16 @@ else
12 DIFFOPT="-r" 12 DIFFOPT="-r"
13fi 13fi
14 14
15DATA=/bin/ls 15DATA=/bin/ls${EXEEXT}
16COPY=${OBJ}/copy 16COPY=${OBJ}/copy
17COPY2=${OBJ}/copy2 17COPY2=${OBJ}/copy2
18DIR=${COPY}.dd 18DIR=${COPY}.dd
19DIR2=${COPY}.dd2 19DIR2=${COPY}.dd2
20 20
21SRC=`dirname ${SCRIPT}` 21SRC=`dirname ${SCRIPT}`
22cp ${SRC}/scp-ssh-wrapper.sh ${OBJ}/scp-ssh-wrapper.exe 22cp ${SRC}/scp-ssh-wrapper.sh ${OBJ}/scp-ssh-wrapper.scp
23chmod 755 ${OBJ}/scp-ssh-wrapper.exe 23chmod 755 ${OBJ}/scp-ssh-wrapper.scp
24scpopts="-q -S ${OBJ}/scp-ssh-wrapper.exe" 24scpopts="-q -S ${OBJ}/scp-ssh-wrapper.scp"
25 25
26scpclean() { 26scpclean() {
27 rm -rf ${COPY} ${COPY2} ${DIR} ${DIR2} 27 rm -rf ${COPY} ${COPY2} ${DIR} ${DIR2}
@@ -64,6 +64,19 @@ cp ${DATA} ${DIR}/copy
64$SCP $scpopts -r somehost:${DIR} ${DIR2} || fail "copy failed" 64$SCP $scpopts -r somehost:${DIR} ${DIR2} || fail "copy failed"
65diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" 65diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
66 66
67if [ ! -z "$SUDO" ]; then
68 verbose "$tid: skipped file after scp -p with failed chown+utimes"
69 scpclean
70 cp -p ${DATA} ${DIR}/copy
71 cp -p ${DATA} ${DIR}/copy2
72 cp ${DATA} ${DIR2}/copy
73 chmod 660 ${DIR2}/copy
74 $SUDO chown root ${DIR2}/copy
75 $SCP -p $scpopts somehost:${DIR}/\* ${DIR2} >/dev/null 2>&1
76 diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
77 $SUDO rm ${DIR2}/copy
78fi
79
67for i in 0 1 2 3 4; do 80for i in 0 1 2 3 4; do
68 verbose "$tid: disallow bad server #$i" 81 verbose "$tid: disallow bad server #$i"
69 SCPTESTMODE=badserver_$i 82 SCPTESTMODE=badserver_$i
@@ -79,4 +92,4 @@ for i in 0 1 2 3 4; do
79done 92done
80 93
81scpclean 94scpclean
82rm -f ${OBJ}/scp-ssh-wrapper.exe 95rm -f ${OBJ}/scp-ssh-wrapper.scp