From 7410ad79f85a62361a6e40ac4ea11e6504408666 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 31 Jan 2006 22:06:14 +1100 Subject: [PATCH] - 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(-) 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