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