bmh10 / rpms / openssh

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