]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: test remote/remote recursive transfers where the source
authordjm@openbsd.org <djm@openbsd.org>
Mon, 13 Oct 2025 00:56:15 +0000 (00:56 +0000)
committerDamien Miller <djm@mindrot.org>
Mon, 13 Oct 2025 00:57:17 +0000 (11:57 +1100)
path ends in ".."

OpenBSD-Regress-ID: 2f42078cfcee986d08b5d135968b8de6186c0003

regress/scp3.sh

index eeb7a9dde475b84bb57b5d164f9307681c0c1000..ef316c099414005c984a27d7792264c37acc0495 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: scp3.sh,v 1.5 2023/09/08 06:10:57 djm Exp $
+#      $OpenBSD: scp3.sh,v 1.6 2025/10/13 00:56:15 djm Exp $
 #      Placed in the Public Domain.
 
 tid="scp3"
@@ -6,6 +6,7 @@ tid="scp3"
 COPY2=${OBJ}/copy2
 DIR=${COPY}.dd
 DIR2=${COPY}.dd2
+DIFFOPT="-rN"
 
 maybe_add_scp_path_to_sshd
 
@@ -63,6 +64,15 @@ for mode in scp sftp ; do
        echo b > ${COPY2}
        $SCP $scpopts -3 hostA:${DATA} hostA:${COPY} hostB:${COPY2}
        cmp ${COPY} ${COPY2} >/dev/null && fail "corrupt target"
+
+       # scp /blah/.. is only supported via the sftp protocol.
+       # Original protocol scp just refuses it.
+       test $mode != sftp && continue
+       verbose "$tag: recursive .."
+       forest
+       $SCP $scpopts -r hostA:${DIR}/subdir/.. hostB:${DIR2} || \
+               fail "copy failed"
+       diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
 done
 
 scpclean