diff options
| author | Ben Fuhrmannek | 2016-03-04 09:51:24 +0100 |
|---|---|---|
| committer | Ben Fuhrmannek | 2016-03-04 09:51:24 +0100 |
| commit | 1b7ec50b72559b21bd9631b74213a34f9d75e830 (patch) | |
| tree | 9b17bd160b94224cc287df97f306852a66f66eab | |
| parent | 64a62f51ba935201599005e5084fc9c13f10fbef (diff) | |
added open_basedir protection against symlink
| -rw-r--r-- | tests/executor/allow_symlink_off.phpt | 24 | ||||
| -rw-r--r-- | tests/executor/allow_symlink_on.phpt | 22 |
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/executor/allow_symlink_off.phpt b/tests/executor/allow_symlink_off.phpt new file mode 100644 index 0000000..8abdee8 --- /dev/null +++ b/tests/executor/allow_symlink_off.phpt | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | --TEST-- | ||
| 2 | suhosin.executor.allow_symlink=Off | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!function_exists("memory_get_usage")) print "skip PHP not compiled with memory_limit support"; ?> | ||
| 5 | --INI-- | ||
| 6 | error_reporting=E_ALL | ||
| 7 | open_basedir= | ||
| 8 | suhosin.log.syslog=0 | ||
| 9 | suhosin.log.sapi=0 | ||
| 10 | suhosin.log.script=0 | ||
| 11 | suhosin.log.file=255 | ||
| 12 | suhosin.log.file.time=0 | ||
| 13 | suhosin.log.file.name={PWD}/suhosintest.$$.log.tmp | ||
| 14 | auto_append_file={PWD}/suhosintest.$$.log.tmp | ||
| 15 | suhosin.executor.allow_symlink=Off | ||
| 16 | --FILE-- | ||
| 17 | <?php | ||
| 18 | symlink(); | ||
| 19 | ini_set("open_basedir", "."); | ||
| 20 | symlink(); | ||
| 21 | ?> | ||
| 22 | --EXPECTF-- | ||
| 23 | Warning: symlink() expects exactly 2 parameters, 0 given in %s on line 2 | ||
| 24 | ALERT - symlink called during open_basedir (attacker 'REMOTE_ADDR not set', file '%s', line 4) | ||
diff --git a/tests/executor/allow_symlink_on.phpt b/tests/executor/allow_symlink_on.phpt new file mode 100644 index 0000000..dbf902c --- /dev/null +++ b/tests/executor/allow_symlink_on.phpt | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | --TEST-- | ||
| 2 | suhosin.executor.allow_symlink=On | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!function_exists("memory_get_usage")) print "skip PHP not compiled with memory_limit support"; ?> | ||
| 5 | --INI-- | ||
| 6 | error_reporting=E_ALL | ||
| 7 | open_basedir= | ||
| 8 | suhosin.log.stdout=255 | ||
| 9 | suhosin.log.script=0 | ||
| 10 | suhosin.log.syslog=0 | ||
| 11 | suhosin.log.sapi=0 | ||
| 12 | suhosin.executor.allow_symlink=On | ||
| 13 | --FILE-- | ||
| 14 | <?php | ||
| 15 | symlink(); | ||
| 16 | ini_set("open_basedir", "."); | ||
| 17 | symlink(); | ||
| 18 | ?> | ||
| 19 | --EXPECTF-- | ||
| 20 | Warning: symlink() expects exactly 2 parameters, 0 given in %s on line 2 | ||
| 21 | |||
| 22 | Warning: symlink() expects exactly 2 parameters, 0 given in %s on line 4 | ||
