diff options
Diffstat (limited to '')
-rwxr-xr-x | testsuite/cpio.tests | 23 | ||||
-rw-r--r-- | testsuite/wget/wget-handles-https | 4 |
2 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/cpio.tests b/testsuite/cpio.tests index 85e746589..a4462c53e 100755 --- a/testsuite/cpio.tests +++ b/testsuite/cpio.tests | |||
@@ -154,6 +154,29 @@ testing "cpio -R with extract" \ | |||
154 | " "" "" | 154 | " "" "" |
155 | SKIP= | 155 | SKIP= |
156 | 156 | ||
157 | # Create an archive containing a file with "../dont_write" filename. | ||
158 | # See that it will not be allowed to unpack. | ||
159 | # NB: GNU cpio 2.15 DOES NOT do such checks. | ||
160 | optional FEATURE_PATH_TRAVERSAL_PROTECTION | ||
161 | rm -rf cpio.testdir | ||
162 | mkdir -p cpio.testdir/prepare/inner | ||
163 | echo "file outside of destination was written" > cpio.testdir/prepare/dont_write | ||
164 | echo "data" > cpio.testdir/prepare/inner/to_extract | ||
165 | mkdir -p cpio.testdir/extract | ||
166 | testing "cpio extract file outside of destination" "\ | ||
167 | (cd cpio.testdir/prepare/inner && echo -e '../dont_write\nto_extract' | cpio -o -H newc) | (cd cpio.testdir/extract && cpio -vi 2>&1) | ||
168 | echo \$? | ||
169 | ls cpio.testdir/dont_write 2>&1" \ | ||
170 | "\ | ||
171 | cpio: removing leading '../' from member names | ||
172 | ../dont_write | ||
173 | to_extract | ||
174 | 1 blocks | ||
175 | 0 | ||
176 | ls: cpio.testdir/dont_write: No such file or directory | ||
177 | " "" "" | ||
178 | SKIP= | ||
179 | |||
157 | # Clean up | 180 | # Clean up |
158 | rm -rf cpio.testdir cpio.testdir2 2>/dev/null | 181 | rm -rf cpio.testdir cpio.testdir2 2>/dev/null |
159 | 182 | ||
diff --git a/testsuite/wget/wget-handles-https b/testsuite/wget/wget-handles-https new file mode 100644 index 000000000..11915f42f --- /dev/null +++ b/testsuite/wget/wget-handles-https | |||
@@ -0,0 +1,4 @@ | |||
1 | test x"$SKIP_INTERNET_TESTS" != x"" && exit | ||
2 | |||
3 | busybox wget -q -O foo https://www.google.com/ | ||
4 | test -s foo | ||