summaryrefslogtreecommitdiff
path: root/regress/scp-ssh-wrapper.sh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-06-16 20:15:59 +1000
committerDarren Tucker <dtucker@zip.com.au>2004-06-16 20:15:59 +1000
commit50433a924344b295cd34ecdbba0c6b8f6add9231 (patch)
tree938e63b00cf4ae56b1579cc085c2a56661b1c980 /regress/scp-ssh-wrapper.sh
parent4c37ef08abc56fe883e75333f04cf2a7382fce07 (diff)
- dtucker@cvs.openbsd.org 2004/06/13 13:51:02
[regress/Makefile regress/test-exec.sh, added regress/scp-ssh-wrapper.sh regress/scp.sh] Add scp regression test; with & ok markus@
Diffstat (limited to 'regress/scp-ssh-wrapper.sh')
-rw-r--r--regress/scp-ssh-wrapper.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/regress/scp-ssh-wrapper.sh b/regress/scp-ssh-wrapper.sh
new file mode 100644
index 00000000..8e431477
--- /dev/null
+++ b/regress/scp-ssh-wrapper.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+# $OpenBSD: scp-ssh-wrapper.sh,v 1.1 2004/06/13 13:51:02 dtucker Exp $
+# Placed in the Public Domain.
+
+printname () {
+ NAME=$1
+ save_IFS=$IFS
+ IFS=/
+ set -- `echo "$NAME"`
+ IFS="$save_IFS"
+ while [ $# -ge 1 ] ; do
+ if [ "x$1" != "x" ]; then
+ echo "D0755 0 $1"
+ fi
+ shift;
+ done
+}
+
+# discard first 5 args
+shift; shift; shift; shift; shift
+
+BAD="../../../../../../../../../../../../../${DIR}/dotpathdir"
+
+case "$SCPTESTMODE" in
+badserver_0)
+ echo "D0755 0 /${DIR}/rootpathdir"
+ echo "C755 2 rootpathfile"
+ echo "X"
+ ;;
+badserver_1)
+ echo "D0755 0 $BAD"
+ echo "C755 2 file"
+ echo "X"
+ ;;
+badserver_2)
+ echo "D0755 0 $BAD"
+ echo "C755 2 file"
+ echo "X"
+ ;;
+badserver_3)
+ printname $BAD
+ echo "C755 2 file"
+ echo "X"
+ ;;
+badserver_4)
+ printname $BAD
+ echo "D0755 0 .."
+ echo "C755 2 file"
+ echo "X"
+ ;;
+*)
+ exec $1
+ ;;
+esac