diff options
Diffstat (limited to 'src/tests/disable_function/disabled_functions_shell_exec_signal.phpt')
| -rw-r--r-- | src/tests/disable_function/disabled_functions_shell_exec_signal.phpt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tests/disable_function/disabled_functions_shell_exec_signal.phpt b/src/tests/disable_function/disabled_functions_shell_exec_signal.phpt new file mode 100644 index 0000000..f99b423 --- /dev/null +++ b/src/tests/disable_function/disabled_functions_shell_exec_signal.phpt | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | --TEST-- | ||
| 2 | Disable functions - shell_exec via signal handler | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | ||
| 5 | <?php if (PHP_VERSION_ID < 70100) print "skip"; ?> | ||
| 6 | --EXTENSIONS-- | ||
| 7 | pcntl | ||
| 8 | --INI-- | ||
| 9 | sp.configuration_file={PWD}/config/disabled_functions_extra.ini | ||
| 10 | pcntl.async_signals=1 | ||
| 11 | --FILE-- | ||
| 12 | <?php | ||
| 13 | declare(ticks=1); | ||
| 14 | ini_set("pcntl.async_signals", "1"); | ||
| 15 | pcntl_signal(SIGALRM, function($signo) { shell_exec("ls"); }); | ||
| 16 | system("kill -14 " . getmypid()); | ||
| 17 | sleep(5); | ||
| 18 | ?> | ||
| 19 | --EXPECTF-- | ||
| 20 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'shell_exec', %a matched a rule in %a.php on line 4 | ||
