jonathancammack / rpms / openssh

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