Skip to content

Commit cd8c96f

Browse files
committed
upstream: test remote/remote recursive transfers where the source
path ends in ".." OpenBSD-Regress-ID: 2f42078cfcee986d08b5d135968b8de6186c0003
1 parent be0777a commit cd8c96f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

regress/scp3.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# $OpenBSD: scp3.sh,v 1.5 2023/09/08 06:10:57 djm Exp $
1+
# $OpenBSD: scp3.sh,v 1.6 2025/10/13 00:56:15 djm Exp $
22
# Placed in the Public Domain.
33

44
tid="scp3"
55

66
COPY2=${OBJ}/copy2
77
DIR=${COPY}.dd
88
DIR2=${COPY}.dd2
9+
DIFFOPT="-rN"
910

1011
maybe_add_scp_path_to_sshd
1112

@@ -63,6 +64,15 @@ for mode in scp sftp ; do
6364
echo b > ${COPY2}
6465
$SCP $scpopts -3 hostA:${DATA} hostA:${COPY} hostB:${COPY2}
6566
cmp ${COPY} ${COPY2} >/dev/null && fail "corrupt target"
67+
68+
# scp /blah/.. is only supported via the sftp protocol.
69+
# Original protocol scp just refuses it.
70+
test $mode != sftp && continue
71+
verbose "$tag: recursive .."
72+
forest
73+
$SCP $scpopts -r hostA:${DIR}/subdir/.. hostB:${DIR2} || \
74+
fail "copy failed"
75+
diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
6676
done
6777

6878
scpclean

0 commit comments

Comments
 (0)