mirror of
https://github.com/openssh/openssh-portable.git
synced 2026-01-12 00:04:08 +08:00
upstream: test implicit destination path selection when source path
ends with ".." OpenBSD-Regress-ID: 42a88e7cdceee8a83879f5730199084ee4a95902
This commit is contained in:
committed by
Damien Miller
parent
4f14ca8633
commit
36a98fccaa
@@ -1,4 +1,4 @@
|
||||
# $OpenBSD: scp.sh,v 1.19 2023/09/08 05:50:57 djm Exp $
|
||||
# $OpenBSD: scp.sh,v 1.20 2025/10/13 00:55:09 djm Exp $
|
||||
# Placed in the Public Domain.
|
||||
|
||||
tid="scp"
|
||||
@@ -199,6 +199,19 @@ for mode in scp sftp ; do
|
||||
echo b > ${COPY2}
|
||||
$SCP $scpopts ${DATA} ${COPY} ${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 local .. to remote dir"
|
||||
forest
|
||||
$SCP $scpopts -r ${DIR}/subdir/.. somehost:${DIR2} || fail "copy failed"
|
||||
diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
|
||||
|
||||
verbose "$tag: recursive remote .. to local dir"
|
||||
forest
|
||||
$SCP $scpopts -r somehost:${DIR}/subdir/.. ${DIR2} || fail "copy failed"
|
||||
diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
|
||||
done
|
||||
|
||||
scpclean
|
||||
|
||||
Reference in New Issue
Block a user