4feb6a9
diff --git a/regress/scp-ssh-wrapper.sh b/regress/scp-ssh-wrapper.sh
4feb6a9
index 59f1ff63..dd48a482 100644
4feb6a9
--- a/regress/scp-ssh-wrapper.sh
4feb6a9
+++ b/regress/scp-ssh-wrapper.sh
4feb6a9
@@ -51,6 +51,18 @@ badserver_4)
4feb6a9
 	echo "C755 2 file"
4feb6a9
 	echo "X"
4feb6a9
 	;;
4feb6a9
+badserver_5)
4feb6a9
+	echo "D0555 0 "
4feb6a9
+	echo "X"
4feb6a9
+	;;
4feb6a9
+badserver_6)
4feb6a9
+	echo "D0555 0 ."
4feb6a9
+	echo "X"
4feb6a9
+	;;
4feb6a9
+badserver_7)
4feb6a9
+	echo "C0755 2 extrafile"
4feb6a9
+	echo "X"
4feb6a9
+	;;
4feb6a9
 *)
4feb6a9
 	set -- $arg
4feb6a9
 	shift
4feb6a9
diff --git a/regress/scp.sh b/regress/scp.sh
4feb6a9
index 57cc7706..104c89e1 100644
4feb6a9
--- a/regress/scp.sh
4feb6a9
+++ b/regress/scp.sh
4feb6a9
@@ -25,6 +25,7 @@ export SCP # used in scp-ssh-wrapper.scp
4feb6a9
 scpclean() {
4feb6a9
 	rm -rf ${COPY} ${COPY2} ${DIR} ${DIR2}
4feb6a9
 	mkdir ${DIR} ${DIR2}
4feb6a9
+	chmod 755 ${DIR} ${DIR2}
4feb6a9
 }
4feb6a9
 
4feb6a9
 verbose "$tid: simple copy local file to local file"
4feb6a9
@@ -101,7 +102,7 @@ if [ ! -z "$SUDO" ]; then
4feb6a9
 	$SUDO rm ${DIR2}/copy
4feb6a9
 fi
4feb6a9
 
4feb6a9
-for i in 0 1 2 3 4; do
4feb6a9
+for i in 0 1 2 3 4 5 6 7; do
4feb6a9
 	verbose "$tid: disallow bad server #$i"
4feb6a9
 	SCPTESTMODE=badserver_$i
4feb6a9
 	export DIR SCPTESTMODE
4feb6a9
@@ -113,6 +114,15 @@ for i in 0 1 2 3 4; do
4feb6a9
 	scpclean
4feb6a9
 	$SCP -r $scpopts somehost:${DATA} ${DIR2} >/dev/null 2>/dev/null
4feb6a9
 	[ -d ${DIR}/dotpathdir ] && fail "allows dir creation outside of subdir"
4feb6a9
+
4feb6a9
+	scpclean
4feb6a9
+	$SCP -pr $scpopts somehost:${DATA} ${DIR2} >/dev/null 2>/dev/null
4feb6a9
+	[ ! -w ${DIR2} ] && fail "allows target root attribute change"
4feb6a9
+
4feb6a9
+	scpclean
4feb6a9
+	$SCP $scpopts somehost:${DATA} ${DIR2} >/dev/null 2>/dev/null
4feb6a9
+	[ -e ${DIR2}/extrafile ] && fail "allows extranous object creation"
4feb6a9
+	rm -f ${DIR2}/extrafile
4feb6a9
 done
4feb6a9
 
4feb6a9
 verbose "$tid: detect non-directory target"
4feb6a9