summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjvoisin2018-10-08 14:34:09 +0200
committerjvoisin2018-10-08 14:34:09 +0200
commitb9c388d1718947f748042586cf77d9b1ce00c61e (patch)
treee19f489684b9177105f6ee89aa1514f580311bbd /src
parent40b2ee2582fcf7d663bed562458ecac16f52b3e3 (diff)
Add a test
Diffstat (limited to 'src')
-rw-r--r--src/tests/config/dump_request_nonwriteable_folder.ini1
-rw-r--r--src/tests/dump_request_nonwriteable_folder.phpt26
2 files changed, 27 insertions, 0 deletions
diff --git a/src/tests/config/dump_request_nonwriteable_folder.ini b/src/tests/config/dump_request_nonwriteable_folder.ini
new file mode 100644
index 0000000..91991bb
--- /dev/null
+++ b/src/tests/config/dump_request_nonwriteable_folder.ini
@@ -0,0 +1 @@
sp.disable_function.function("system").drop().dump("/etc/");
diff --git a/src/tests/dump_request_nonwriteable_folder.phpt b/src/tests/dump_request_nonwriteable_folder.phpt
new file mode 100644
index 0000000..84eb2f2
--- /dev/null
+++ b/src/tests/dump_request_nonwriteable_folder.phpt
@@ -0,0 +1,26 @@
1--TEST--
2Dump request - nonwriteable folder.
3--SKIPIF--
4<?php
5if (!extension_loaded("snuffleupagus")) { print "skip"; }
6?>
7--POST--
8post_a=data_post_a&post_b=data_post_b
9--GET--
10get_a=data_get_a&get_b=data_get_b
11--COOKIE--
12cookie_a=data_cookie_a&cookie_b=data_cookie_b
13--INI--
14sp.configuration_file={PWD}/config/dump_request_nonwriteable_folder.ini
15--FILE--
16<?php
17echo "1\n";
18echo system("echo 1337;");
19echo "2\n";
20?>
21--EXPECTF--
221
23
24Warning: [snuffleupagus][request_logging] Unable to open %a: Permission denied in %a/tests/dump_request_nonwriteable_folder.php on line %d
25
26Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'system' in %a/tests/dump_request_nonwriteable_folder.php on line 3