diff options
-rw-r--r-- | regress/scp-ssh-wrapper.sh | 14 | ||||
-rw-r--r-- | regress/scp.sh | 14 |
2 files changed, 25 insertions, 3 deletions
diff --git a/regress/scp-ssh-wrapper.sh b/regress/scp-ssh-wrapper.sh index 59f1ff63e..7fb21f424 100644 --- a/regress/scp-ssh-wrapper.sh +++ b/regress/scp-ssh-wrapper.sh | |||
@@ -1,5 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # $OpenBSD: scp-ssh-wrapper.sh,v 1.3 2014/01/26 10:49:17 djm Exp $ | 2 | # $OpenBSD: scp-ssh-wrapper.sh,v 1.4 2019/07/19 03:45:44 djm Exp $ |
3 | # Placed in the Public Domain. | 3 | # Placed in the Public Domain. |
4 | 4 | ||
5 | printname () { | 5 | printname () { |
@@ -51,6 +51,18 @@ badserver_4) | |||
51 | echo "C755 2 file" | 51 | echo "C755 2 file" |
52 | echo "X" | 52 | echo "X" |
53 | ;; | 53 | ;; |
54 | badserver_5) | ||
55 | echo "D0555 0 " | ||
56 | echo "X" | ||
57 | ;; | ||
58 | badserver_6) | ||
59 | echo "D0555 0 ." | ||
60 | echo "X" | ||
61 | ;; | ||
62 | badserver_7) | ||
63 | echo "C0755 2 extrafile" | ||
64 | echo "X" | ||
65 | ;; | ||
54 | *) | 66 | *) |
55 | set -- $arg | 67 | set -- $arg |
56 | shift | 68 | shift |
diff --git a/regress/scp.sh b/regress/scp.sh index 57cc77066..62400efad 100644 --- a/regress/scp.sh +++ b/regress/scp.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: scp.sh,v 1.10 2014/01/26 10:49:17 djm Exp $ | 1 | # $OpenBSD: scp.sh,v 1.11 2019/07/19 03:45:44 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="scp" | 4 | tid="scp" |
@@ -25,6 +25,7 @@ export SCP # used in scp-ssh-wrapper.scp | |||
25 | scpclean() { | 25 | scpclean() { |
26 | rm -rf ${COPY} ${COPY2} ${DIR} ${DIR2} | 26 | rm -rf ${COPY} ${COPY2} ${DIR} ${DIR2} |
27 | mkdir ${DIR} ${DIR2} | 27 | mkdir ${DIR} ${DIR2} |
28 | chmod 755 ${DIR} ${DIR2} | ||
28 | } | 29 | } |
29 | 30 | ||
30 | verbose "$tid: simple copy local file to local file" | 31 | verbose "$tid: simple copy local file to local file" |
@@ -101,7 +102,7 @@ if [ ! -z "$SUDO" ]; then | |||
101 | $SUDO rm ${DIR2}/copy | 102 | $SUDO rm ${DIR2}/copy |
102 | fi | 103 | fi |
103 | 104 | ||
104 | for i in 0 1 2 3 4; do | 105 | for i in 0 1 2 3 4 5 6 7; do |
105 | verbose "$tid: disallow bad server #$i" | 106 | verbose "$tid: disallow bad server #$i" |
106 | SCPTESTMODE=badserver_$i | 107 | SCPTESTMODE=badserver_$i |
107 | export DIR SCPTESTMODE | 108 | export DIR SCPTESTMODE |
@@ -113,6 +114,15 @@ for i in 0 1 2 3 4; do | |||
113 | scpclean | 114 | scpclean |
114 | $SCP -r $scpopts somehost:${DATA} ${DIR2} >/dev/null 2>/dev/null | 115 | $SCP -r $scpopts somehost:${DATA} ${DIR2} >/dev/null 2>/dev/null |
115 | [ -d ${DIR}/dotpathdir ] && fail "allows dir creation outside of subdir" | 116 | [ -d ${DIR}/dotpathdir ] && fail "allows dir creation outside of subdir" |
117 | |||
118 | scpclean | ||
119 | $SCP -pr $scpopts somehost:${DATA} ${DIR2} >/dev/null 2>/dev/null | ||
120 | [ ! -w ${DIR2} ] && fail "allows target root attribute change" | ||
121 | |||
122 | scpclean | ||
123 | $SCP $scpopts somehost:${DATA} ${DIR2} >/dev/null 2>/dev/null | ||
124 | [ -e ${DIR2}/extrafile ] && fail "allows unauth object creation" | ||
125 | rm -f ${DIR2}/extrafile | ||
116 | done | 126 | done |
117 | 127 | ||
118 | verbose "$tid: detect non-directory target" | 128 | verbose "$tid: detect non-directory target" |