[openssh-commits] [openssh] 05/05: upstream: regress test for unmatched glob characters; fails before

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Oct 25 08:57:00 AEDT 2022


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 7190154de2c9fe135f0cc1ad349cb2fa45152b89
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Mon Oct 24 21:52:50 2022 +0000

    upstream: regress test for unmatched glob characters; fails before
    
    previous commit but passes now. bz3488; prodded by dtucker@
    
    OpenBSD-Regress-ID: 0cc5cc9ea4a6fd170dc61b9212f15badaafb3bbd
---
 regress/scp.sh | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/regress/scp.sh b/regress/scp.sh
index f47c5945..44e6485b 100644
--- a/regress/scp.sh
+++ b/regress/scp.sh
@@ -15,6 +15,8 @@ fi
 COPY2=${OBJ}/copy2
 DIR=${COPY}.dd
 DIR2=${COPY}.dd2
+COPY3=${OBJ}/copy.glob[123]
+DIR3=${COPY}.dd.glob[456]
 
 SRC=`dirname ${SCRIPT}`
 cp ${SRC}/scp-ssh-wrapper.sh ${OBJ}/scp-ssh-wrapper.scp
@@ -22,9 +24,9 @@ chmod 755 ${OBJ}/scp-ssh-wrapper.scp
 export SCP # used in scp-ssh-wrapper.scp
 
 scpclean() {
-	rm -rf ${COPY} ${COPY2} ${DIR} ${DIR2}
-	mkdir ${DIR} ${DIR2}
-	chmod 755 ${DIR} ${DIR2}
+	rm -rf ${COPY} ${COPY2} ${DIR} ${DIR2} ${COPY3} ${DIR3}
+	mkdir ${DIR} ${DIR2} ${DIR3}
+	chmod 755 ${DIR} ${DIR2} ${DIR3}
 }
 
 for mode in scp sftp ; do
@@ -113,6 +115,30 @@ for mode in scp sftp ; do
 	$SCP $scpopts -r somehost:${DIR} ${DIR2} || fail "copy failed"
 	diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
 
+	verbose "$tag: unmatched glob file local->remote"
+	scpclean
+	$SCP $scpopts ${DATA} somehost:${COPY3} || fail "copy failed"
+	cmp ${DATA} ${COPY3} || fail "corrupted copy"
+
+	verbose "$tag: unmatched glob file remote->local"
+	# NB. no clean
+	$SCP $scpopts somehost:${COPY3} ${COPY2} || fail "copy failed"
+	cmp ${DATA} ${COPY2} || fail "corrupted copy"
+
+	verbose "$tag: unmatched glob dir recursive local->remote"
+	scpclean
+	rm -rf ${DIR3}
+	cp ${DATA} ${DIR}/copy
+	cp ${DATA} ${DIR}/copy.glob[1234]
+	$SCP $scpopts -r ${DIR} somehost:${DIR3} || fail "copy failed"
+	diff -rN ${DIR} ${DIR3} || fail "corrupted copy"
+
+	verbose "$tag: unmatched glob dir recursive remote->local"
+	# NB. no clean
+	rm -rf ${DIR2}
+	$SCP $scpopts -r somehost:${DIR3} ${DIR2} || fail "copy failed"
+	diff -rN ${DIR} ${DIR2} || fail "corrupted copy"
+
 	verbose "$tag: shell metacharacters"
 	scpclean
 	(cd ${DIR} && \

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list