summaryrefslogtreecommitdiff
path: root/tests/include/include_allow_writable_files_off.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/include/include_allow_writable_files_off.phpt')
-rw-r--r--tests/include/include_allow_writable_files_off.phpt31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/include/include_allow_writable_files_off.phpt b/tests/include/include_allow_writable_files_off.phpt
new file mode 100644
index 0000000..3fb9e89
--- /dev/null
+++ b/tests/include/include_allow_writable_files_off.phpt
@@ -0,0 +1,31 @@
1--TEST--
2Testing suhosin.executor.include.allow_writable_files=Off
3--DESCRIPTION--
4Because the test file itself is writable the whole test case is not executed!!!
5--SKIPIF--
6<?php include "../skipifcli.inc"; ?>
7--INI--
8suhosin.log.syslog=0
9suhosin.log.sapi=255
10suhosin.log.script=0
11suhosin.log.phpscript=0
12suhosin.executor.include.whitelist=
13suhosin.executor.include.blacklist=
14suhosin.executor.include.allow_writable_files=Off
15--FILE--
16<?php
17/* Because the test file itself is writable the whole test case is not executed!!! */
18$filename1 = tempnam(sys_get_temp_dir(), "suhosintestf1");
19$filename2 = tempnam(sys_get_temp_dir(), "suhosintestf2");
20file_put_contents($filename1, "<?php echo \"AAAA\\n\";");
21file_put_contents($filename2, "<?php echo \"BBBB\\n\";");
22chmod($filename1, 0400);
23chmod($filename2, 0600);
24include $filename1;
25include $filename2;
26chmod($filename1, 0600);
27unlink($filename1);
28unlink($filename2);
29?>
30--EXPECTF--
31ALERT - Include filename ('%s') is writable by PHP process (attacker 'REMOTE_ADDR not set', file '%s')