kentpeacock / rpms / openssh

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