diff options
| author | jvoisin | 2018-01-19 11:43:13 +0100 |
|---|---|---|
| committer | jvoisin | 2018-01-19 11:43:13 +0100 |
| commit | 093b89fb9e95012ab950febc6c51360e6a2d189a (patch) | |
| tree | 913bfac399ccba03eadbeee90dec381412f74243 | |
| parent | 4c220390c4e84597933ad1591709cb03b5afeb19 (diff) | |
The testsuite is now successfully running under the root user
This closes #131
| -rw-r--r-- | src/tests/deny_writable_execution_simulation.phpt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tests/deny_writable_execution_simulation.phpt b/src/tests/deny_writable_execution_simulation.phpt index 85b909c..d1ccb7c 100644 --- a/src/tests/deny_writable_execution_simulation.phpt +++ b/src/tests/deny_writable_execution_simulation.phpt | |||
| @@ -3,7 +3,17 @@ Readonly execution attempt (simulation mode) | |||
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php | 4 | <?php |
| 5 | if (!extension_loaded("snuffleupagus")) print "skip"; | 5 | if (!extension_loaded("snuffleupagus")) print "skip"; |
| 6 | if (0 == posix_getuid()) print "skip"; // root has write privileges on any file | 6 | |
| 7 | // root has write privileges on any file | ||
| 8 | if (TRUE == function_exists("posix_getuid")) { | ||
| 9 | if (0 == posix_getuid()) { | ||
| 10 | print "skip"; | ||
| 11 | } | ||
| 12 | } elseif (TRUE == function_exists("shell_exec")) { | ||
| 13 | if ("root" == trim(shell_exec("whoami"))) { | ||
| 14 | print "skip"; | ||
| 15 | } | ||
| 16 | } | ||
| 7 | ?> | 17 | ?> |
| 8 | --INI-- | 18 | --INI-- |
| 9 | sp.configuration_file={PWD}/config/config_disable_writable_simulation.ini | 19 | sp.configuration_file={PWD}/config/config_disable_writable_simulation.ini |
