- markus@cvs.openbsd.org 2005/07/25 11:59:40
[openssh-git.git] / regress / scp-ssh-wrapper.sh
blob8e4314773119f8973565a3223e9cf27d123fc4c3
1 #!/bin/sh
2 # $OpenBSD: scp-ssh-wrapper.sh,v 1.1 2004/06/13 13:51:02 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 first 5 args
20 shift; shift; shift; shift; shift
22 BAD="../../../../../../../../../../../../../${DIR}/dotpathdir"
24 case "$SCPTESTMODE" in
25 badserver_0)
26 echo "D0755 0 /${DIR}/rootpathdir"
27 echo "C755 2 rootpathfile"
28 echo "X"
30 badserver_1)
31 echo "D0755 0 $BAD"
32 echo "C755 2 file"
33 echo "X"
35 badserver_2)
36 echo "D0755 0 $BAD"
37 echo "C755 2 file"
38 echo "X"
40 badserver_3)
41 printname $BAD
42 echo "C755 2 file"
43 echo "X"
45 badserver_4)
46 printname $BAD
47 echo "D0755 0 .."
48 echo "C755 2 file"
49 echo "X"
52 exec $1
54 esac