From 10c5fa7e8766c332b1e04e95fc5d761ee2407214 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 31 Jan 2006 22:01:42 +1100 Subject: - markus@cvs.openbsd.org 2005/06/30 11:02:37 [regress/scp.sh] allow SUDO=sudo; from Alexander Bluhm --- regress/scp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'regress/scp.sh') diff --git a/regress/scp.sh b/regress/scp.sh index c3034b6e7..1043b8ea2 100644 --- a/regress/scp.sh +++ b/regress/scp.sh @@ -1,4 +1,4 @@ -# $OpenBSD: scp.sh,v 1.3 2004/07/08 12:59:35 dtucker Exp $ +# $OpenBSD: scp.sh,v 1.4 2005/06/30 11:02:37 markus Exp $ # Placed in the Public Domain. tid="scp" @@ -73,7 +73,7 @@ if [ ! -z "$SUDO" ]; then chmod 660 ${DIR2}/copy $SUDO chown root ${DIR2}/copy $SCP -p $scpopts somehost:${DIR}/\* ${DIR2} >/dev/null 2>&1 - diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" + $SUDO diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" $SUDO rm ${DIR2}/copy fi -- cgit v1.2.3 From 0b996462f842e6b5a5d409ad4538e1779dd69bf6 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 31 Jan 2006 22:05:23 +1100 Subject: - djm@cvs.openbsd.org 2006/01/27 06:49:21 [scp.sh] regress test for local to local scp copies; ok dtucker@ --- ChangeLog | 5 ++++- regress/scp.sh | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'regress/scp.sh') diff --git a/ChangeLog b/ChangeLog index 377e6242b..4cdd5714d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -60,6 +60,9 @@ [regress/scp-ssh-wrapper.sh] Fix assumption about how many args scp will pass; ok djm@ NB. ID sync only, we already had this + - djm@cvs.openbsd.org 2006/01/27 06:49:21 + [scp.sh] + regress test for local to local scp copies; ok dtucker@ 20060129 - (dtucker) [configure.ac opensshd.init.in] Bug #1144: Use /bin/sh for the @@ -3785,4 +3788,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4108 2006/01/31 11:03:11 djm Exp $ +$Id: ChangeLog,v 1.4109 2006/01/31 11:05:23 djm Exp $ diff --git a/regress/scp.sh b/regress/scp.sh index 1043b8ea2..02f541011 100644 --- a/regress/scp.sh +++ b/regress/scp.sh @@ -1,4 +1,4 @@ -# $OpenBSD: scp.sh,v 1.4 2005/06/30 11:02:37 markus Exp $ +# $OpenBSD: scp.sh,v 1.5 2006/01/27 06:49:21 djm Exp $ # Placed in the Public Domain. tid="scp" @@ -28,6 +28,11 @@ scpclean() { mkdir ${DIR} ${DIR2} } +verbose "$tid: simple copy local file to local file" +scpclean +$SCP $scpopts ${DATA} ${COPY} || fail "copy failed" +cmp ${DATA} ${COPY} || fail "corrupted copy" + verbose "$tid: simple copy local file to remote file" scpclean $SCP $scpopts ${DATA} somehost:${COPY} || fail "copy failed" @@ -44,6 +49,12 @@ cp ${DATA} ${COPY} $SCP $scpopts ${COPY} somehost:${DIR} || fail "copy failed" cmp ${COPY} ${DIR}/copy || fail "corrupted copy" +verbose "$tid: simple copy local file to local dir" +scpclean +cp ${DATA} ${COPY} +$SCP $scpopts ${COPY} ${DIR} || fail "copy failed" +cmp ${COPY} ${DIR}/copy || fail "corrupted copy" + verbose "$tid: simple copy remote file to local dir" scpclean cp ${DATA} ${COPY} @@ -57,6 +68,13 @@ cp ${DATA} ${DIR}/copy $SCP $scpopts -r ${DIR} somehost:${DIR2} || fail "copy failed" diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" +verbose "$tid: recursive local dir to local dir" +scpclean +rm -rf ${DIR2} +cp ${DATA} ${DIR}/copy +$SCP $scpopts -r ${DIR} ${DIR2} || fail "copy failed" +diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" + verbose "$tid: recursive remote dir to local dir" scpclean rm -rf ${DIR2} -- cgit v1.2.3 From 7410ad79f85a62361a6e40ac4ea11e6504408666 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 31 Jan 2006 22:06:14 +1100 Subject: - djm@cvs.openbsd.org 2006/01/31 10:23:23 [scp.sh] regression test for CVE-2006-0225 written by dtucker@ --- ChangeLog | 5 ++++- regress/scp.sh | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'regress/scp.sh') diff --git a/ChangeLog b/ChangeLog index 4cdd5714d..1851eab95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -63,6 +63,9 @@ - djm@cvs.openbsd.org 2006/01/27 06:49:21 [scp.sh] regress test for local to local scp copies; ok dtucker@ + - djm@cvs.openbsd.org 2006/01/31 10:23:23 + [scp.sh] + regression test for CVE-2006-0225 written by dtucker@ 20060129 - (dtucker) [configure.ac opensshd.init.in] Bug #1144: Use /bin/sh for the @@ -3788,4 +3791,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4109 2006/01/31 11:05:23 djm Exp $ +$Id: ChangeLog,v 1.4110 2006/01/31 11:06:14 djm Exp $ diff --git a/regress/scp.sh b/regress/scp.sh index 02f541011..bfda670bb 100644 --- a/regress/scp.sh +++ b/regress/scp.sh @@ -1,4 +1,4 @@ -# $OpenBSD: scp.sh,v 1.5 2006/01/27 06:49:21 djm Exp $ +# $OpenBSD: scp.sh,v 1.6 2006/01/31 10:23:23 djm Exp $ # Placed in the Public Domain. tid="scp" @@ -82,6 +82,13 @@ cp ${DATA} ${DIR}/copy $SCP $scpopts -r somehost:${DIR} ${DIR2} || fail "copy failed" diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy" +verbose "$tid: shell metacharacters" +scpclean +(cd ${DIR} && \ +touch '`touch metachartest`' && \ +$SCP $scpopts *metachar* ${DIR2} 2>/dev/null; \ +[ ! -f metachartest ] ) || fail "shell metacharacters" + if [ ! -z "$SUDO" ]; then verbose "$tid: skipped file after scp -p with failed chown+utimes" scpclean -- cgit v1.2.3 From 50c6eedce395ad0b828067c5e65ce9eb9e1543af Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 31 Jan 2006 22:06:41 +1100 Subject: - djm@cvs.openbsd.org 2006/01/31 10:36:33 [scp.sh] regress test for "scp a b c" where "c" is not a directory --- ChangeLog | 5 ++++- regress/scp.sh | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'regress/scp.sh') diff --git a/ChangeLog b/ChangeLog index 1851eab95..901611fef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -66,6 +66,9 @@ - djm@cvs.openbsd.org 2006/01/31 10:23:23 [scp.sh] regression test for CVE-2006-0225 written by dtucker@ + - djm@cvs.openbsd.org 2006/01/31 10:36:33 + [scp.sh] + regress test for "scp a b c" where "c" is not a directory 20060129 - (dtucker) [configure.ac opensshd.init.in] Bug #1144: Use /bin/sh for the @@ -3791,4 +3794,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4110 2006/01/31 11:06:14 djm Exp $ +$Id: ChangeLog,v 1.4111 2006/01/31 11:06:41 djm Exp $ diff --git a/regress/scp.sh b/regress/scp.sh index bfda670bb..c5d412dd9 100644 --- a/regress/scp.sh +++ b/regress/scp.sh @@ -1,4 +1,4 @@ -# $OpenBSD: scp.sh,v 1.6 2006/01/31 10:23:23 djm Exp $ +# $OpenBSD: scp.sh,v 1.7 2006/01/31 10:36:33 djm Exp $ # Placed in the Public Domain. tid="scp" @@ -116,5 +116,12 @@ for i in 0 1 2 3 4; do [ -d ${DIR}/dotpathdir ] && fail "allows dir creation outside of subdir" done +verbose "$tid: detect non-directory target" +scpclean +echo a > ${COPY} +echo b > ${COPY2} +$SCP $scpopts ${DATA} ${COPY} ${COPY2} +cmp ${COPY} ${COPY2} >/dev/null && fail "corrupt target" + scpclean rm -f ${OBJ}/scp-ssh-wrapper.scp -- cgit v1.2.3