- (djm) Release 4.6p1
[openssh-git.git] / regress / scp-ssh-wrapper.sh
blobd1005a995a176696915f4ee0a61b7d6860ebfa32
1 #!/bin/sh
2 # $OpenBSD: scp-ssh-wrapper.sh,v 1.2 2005/12/14 04:36:39 dtucker Exp $
3 # Placed in the Public Domain.
5 printname () {
6 NAME=$1
7 save_IFS=$IFS
8 IFS=/
9 set -- `echo "$NAME"`
10 IFS="$save_IFS"
11 while [ $# -ge 1 ] ; do
12 if [ "x$1" != "x" ]; then
13 echo "D0755 0 $1"
15 shift;
16 done
19 # Discard all but last argument. We use arg later.
20 while test "$1" != ""; do
21 arg="$1"
22 shift
23 done
25 BAD="../../../../../../../../../../../../../${DIR}/dotpathdir"
27 case "$SCPTESTMODE" in
28 badserver_0)
29 echo "D0755 0 /${DIR}/rootpathdir"
30 echo "C755 2 rootpathfile"
31 echo "X"
33 badserver_1)
34 echo "D0755 0 $BAD"
35 echo "C755 2 file"
36 echo "X"
38 badserver_2)
39 echo "D0755 0 $BAD"
40 echo "C755 2 file"
41 echo "X"
43 badserver_3)
44 printname $BAD
45 echo "C755 2 file"
46 echo "X"
48 badserver_4)
49 printname $BAD
50 echo "D0755 0 .."
51 echo "C755 2 file"
52 echo "X"
55 exec $arg
57 esac