From eb570f29daa42fd8b90ecfff75382846e51b3a15 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 10 Dec 2022 12:00:36 +0100 Subject: Add support for PHP8.2 --- .../deny_writable_execution_disabled.phpt | 12 ++++------ .../disabled_functions_callback_called_file_r.phpt | 5 ---- .../disabled_functions_called_file_r.phpt | 5 ---- .../disabled_functions_include_once.phpt | 13 +++++----- .../disabled_functions_include_simulation.phpt | 13 +++++----- .../disabled_functions_require.phpt | 13 +++++----- .../disabled_functions_require_allow.phpt | 11 ++++----- .../disabled_functions_require_once.phpt | 12 ++++------ .../disabled_functions_require_simulation.phpt | 12 ++++------ .../disabled_functions_runtime.phpt | 11 ++++----- src/tests/dump_request/dump_eval_blacklist.phpt | 9 ------- src/tests/dump_request/dump_eval_whitelist.phpt | 9 ------- src/tests/dump_request/dump_request.phpt | 16 ++++++------- .../dump_request/dump_request_stacktrace.phpt | 9 ------- src/tests/dump_request/dump_request_too_big.phpt | 15 +++++------- .../eval_whitelist_include_then_user.phpt | 10 ++++---- .../stream_wrapper/stream_wrapper_register.phpt | 1 + .../stream_wrapper_register_php82.phpt | 28 ++++++++++++++++++++++ src/tests/xxe/disable_xxe_dom_disabled_php8.phpt | 10 ++++---- src/tests/xxe/disable_xxe_dom_php8.phpt | 13 +++++----- 20 files changed, 99 insertions(+), 128 deletions(-) create mode 100644 src/tests/stream_wrapper/stream_wrapper_register_php82.phpt (limited to 'src') diff --git a/src/tests/deny_writable/deny_writable_execution_disabled.phpt b/src/tests/deny_writable/deny_writable_execution_disabled.phpt index dd01f01..0fd19f4 100644 --- a/src/tests/deny_writable/deny_writable_execution_disabled.phpt +++ b/src/tests/deny_writable/deny_writable_execution_disabled.phpt @@ -18,15 +18,13 @@ chmod("$dir/writable_file.txt", 0777); chmod("$dir/non_writable_file.txt", 0400); include "$dir/writable_file.txt"; include "$dir/non_writable_file.txt"; -?> ---EXPECT-- -Code execution within a writable file. -Code execution within a non-writable file. ---CLEAN-- - +--EXPECT-- +Code execution within a writable file. +Code execution within a non-writable file. diff --git a/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt b/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt index ec75d74..d977733 100644 --- a/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt +++ b/src/tests/disable_function/disabled_functions_callback_called_file_r.phpt @@ -29,11 +29,6 @@ include "$dir/myfunc_callback.php"; echo test('test_callback'); -?> ---CLEAN-- - --EXPECTF-- Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test_callback' in %a/myfunc_callback.php on line 4 diff --git a/src/tests/disable_function/disabled_functions_called_file_r.phpt b/src/tests/disable_function/disabled_functions_called_file_r.phpt index dde26f7..2ba06d4 100644 --- a/src/tests/disable_function/disabled_functions_called_file_r.phpt +++ b/src/tests/disable_function/disabled_functions_called_file_r.phpt @@ -24,11 +24,6 @@ include "$dir/myfunc.php"; test(); -?> ---CLEAN-- - --EXPECTF-- Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'test' in %a/myfunc.php on line 3 diff --git a/src/tests/disable_function/disabled_functions_include_once.phpt b/src/tests/disable_function/disabled_functions_include_once.phpt index 57cb5a1..8b1bec8 100644 --- a/src/tests/disable_function/disabled_functions_include_once.phpt +++ b/src/tests/disable_function/disabled_functions_include_once.phpt @@ -7,21 +7,20 @@ sp.configuration_file={PWD}/config/config_disabled_functions_include.ini --FILE-- ---CLEAN-- - --EXPECTF-- BLA -Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include_once', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_once.php on line 6 +Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include_once', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_once.php on line %d MEH 1337 diff --git a/src/tests/disable_function/disabled_functions_include_simulation.phpt b/src/tests/disable_function/disabled_functions_include_simulation.phpt index 53ea2a4..cf2c693 100644 --- a/src/tests/disable_function/disabled_functions_include_simulation.phpt +++ b/src/tests/disable_function/disabled_functions_include_simulation.phpt @@ -7,21 +7,20 @@ sp.configuration_file={PWD}/config/config_disabled_functions_include.ini --FILE-- ---CLEAN-- - --EXPECTF-- BLA -Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_simulation.php on line 6 +Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'include', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_include_simulation.php on line %d MEH 1337 diff --git a/src/tests/disable_function/disabled_functions_require.phpt b/src/tests/disable_function/disabled_functions_require.phpt index df2b2f0..bf59b58 100644 --- a/src/tests/disable_function/disabled_functions_require.phpt +++ b/src/tests/disable_function/disabled_functions_require.phpt @@ -7,18 +7,17 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require.ini --FILE-- ---CLEAN-- - --EXPECTF-- BLA -Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require.php on line 6 +Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require.php on line %d diff --git a/src/tests/disable_function/disabled_functions_require_allow.phpt b/src/tests/disable_function/disabled_functions_require_allow.phpt index 7ab29aa..37a7e33 100644 --- a/src/tests/disable_function/disabled_functions_require_allow.phpt +++ b/src/tests/disable_function/disabled_functions_require_allow.phpt @@ -7,6 +7,11 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require_allow.ini --FILE-- diff --git a/src/tests/disable_function/disabled_functions_require_once.phpt b/src/tests/disable_function/disabled_functions_require_once.phpt index 7356c08..81049ef 100644 --- a/src/tests/disable_function/disabled_functions_require_once.phpt +++ b/src/tests/disable_function/disabled_functions_require_once.phpt @@ -7,18 +7,16 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require.ini --FILE-- ---CLEAN-- - --EXPECTF-- BLA -Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require_once', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require_once.php on line 6 +Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'require_once', because its argument 'inclusion path' content (%a/test.meh) matched a rule in %a/disabled_functions_require_once.php on line %d diff --git a/src/tests/disable_function/disabled_functions_require_simulation.phpt b/src/tests/disable_function/disabled_functions_require_simulation.phpt index fa1523c..2c52610 100644 --- a/src/tests/disable_function/disabled_functions_require_simulation.phpt +++ b/src/tests/disable_function/disabled_functions_require_simulation.phpt @@ -7,21 +7,19 @@ sp.configuration_file={PWD}/config/config_disabled_functions_require.ini --FILE-- ---CLEAN-- - --EXPECTF-- BLA -Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_require_simulation.php on line 6 +Warning: [snuffleupagus][0.0.0.0][disabled_function][simulation] Aborted execution on call of the function 'require', because its argument 'inclusion path' content (%a/test.sim) matched a rule in %a/disabled_functions_require_simulation.php on line %d MEH 1337 diff --git a/src/tests/disable_function/disabled_functions_runtime.phpt b/src/tests/disable_function/disabled_functions_runtime.phpt index 16ecfdb..8175a77 100644 --- a/src/tests/disable_function/disabled_functions_runtime.phpt +++ b/src/tests/disable_function/disabled_functions_runtime.phpt @@ -6,8 +6,12 @@ Disable functions - runtime inclusion sp.configuration_file={PWD}/config/config_disabled_functions_param_runtime.ini --FILE-- ---CLEAN-- - --EXPECTF-- 1338 diff --git a/src/tests/dump_request/dump_eval_blacklist.phpt b/src/tests/dump_request/dump_eval_blacklist.phpt index e294703..ae6ffc0 100644 --- a/src/tests/dump_request/dump_eval_blacklist.phpt +++ b/src/tests/dump_request/dump_eval_blacklist.phpt @@ -4,15 +4,6 @@ Dump eval blacklist ---CLEAN-- - --POST-- post_a=data_post_a&post_b=data_post_b --GET-- diff --git a/src/tests/dump_request/dump_eval_whitelist.phpt b/src/tests/dump_request/dump_eval_whitelist.phpt index 7385146..09f5523 100644 --- a/src/tests/dump_request/dump_eval_whitelist.phpt +++ b/src/tests/dump_request/dump_eval_whitelist.phpt @@ -4,15 +4,6 @@ Dump eval whitelist ---CLEAN-- - --POST-- post_a=data_post_a&post_b=data_post_b --GET-- diff --git a/src/tests/dump_request/dump_request.phpt b/src/tests/dump_request/dump_request.phpt index e955776..7ad0323 100644 --- a/src/tests/dump_request/dump_request.phpt +++ b/src/tests/dump_request/dump_request.phpt @@ -6,15 +6,6 @@ if (!extension_loaded("snuffleupagus")) { print "skip"; } ?> ---CLEAN-- - --POST-- post_a=data_post_a&post_b=data_post_b --GET-- @@ -25,6 +16,13 @@ cookie_a=data_cookie_a&cookie_b=data_cookie_b sp.configuration_file={PWD}/config/dump_request.ini --FILE-- ---CLEAN-- - --POST-- post_a=data_post_a&post_b=data_post_b --GET-- diff --git a/src/tests/dump_request/dump_request_too_big.phpt b/src/tests/dump_request/dump_request_too_big.phpt index 4fc8f81..b143bd0 100644 --- a/src/tests/dump_request/dump_request_too_big.phpt +++ b/src/tests/dump_request/dump_request_too_big.phpt @@ -6,15 +6,6 @@ if (!extension_loaded("snuffleupagus")) { print "skip"; } ?> ---CLEAN-- - --POST-- post_a=data_post_a&post_b=data_post_b&post_c=c --GET-- @@ -29,6 +20,12 @@ END; sp.configuration_file={PWD}/config/dump_request.ini --FILE-- '); $a = cos(1); @@ -18,13 +21,8 @@ echo "After allowed eval: $a\n"; eval("include_once('$dir' . '/test.bla');"); echo "After eval: $b\n"; ?> ---CLEAN-- - --EXPECTF-- Outside of eval: 0.54030230586814 After allowed eval: 0.28366218546323 -Fatal error: [snuffleupagus][0.0.0.0][Eval_whitelist][drop] The function 'sin' isn't in the eval whitelist, dropping its call. in %a/test.bla on line 1 \ No newline at end of file +Fatal error: [snuffleupagus][0.0.0.0][Eval_whitelist][drop] The function 'sin' isn't in the eval whitelist, dropping its call. in %a/test.bla on line 1 diff --git a/src/tests/stream_wrapper/stream_wrapper_register.phpt b/src/tests/stream_wrapper/stream_wrapper_register.phpt index 27d8afb..4fa9ea8 100644 --- a/src/tests/stream_wrapper/stream_wrapper_register.phpt +++ b/src/tests/stream_wrapper/stream_wrapper_register.phpt @@ -2,6 +2,7 @@ Stream wrapper --SKIPIF-- += 80200) print "skip"; ?> --INI-- sp.configuration_file={PWD}/config/config_stream_wrapper_register.ini --FILE-- diff --git a/src/tests/stream_wrapper/stream_wrapper_register_php82.phpt b/src/tests/stream_wrapper/stream_wrapper_register_php82.phpt new file mode 100644 index 0000000..b03a2f1 --- /dev/null +++ b/src/tests/stream_wrapper/stream_wrapper_register_php82.phpt @@ -0,0 +1,28 @@ +--TEST-- +Stream wrapper on PHP8.2+ +--SKIPIF-- + + +--INI-- +sp.configuration_file={PWD}/config/config_stream_wrapper_register.ini +--FILE-- + +--EXPECTF-- +Deprecated: Creation of dynamic property qwe::$context is deprecated in %s/tests/stream_wrapper/stream_wrapper_register_php82.php on line %d + +Warning: fopen(): Unable to find the wrapper "lolol" - did you forget to enable it when you configured PHP? in %a/stream_wrapper_register_php82.php on line %d + +Warning: fopen(): file:// wrapper is disabled in the server configuration in %a/stream_wrapper_register_php82.php on line %d + +Warning: fopen(lolol://asdasd): %s to open stream: no suitable wrapper could be found in %a/stream_wrapper_register_php82.php on line %d diff --git a/src/tests/xxe/disable_xxe_dom_disabled_php8.phpt b/src/tests/xxe/disable_xxe_dom_disabled_php8.phpt index 01e3349..a78fe2d 100644 --- a/src/tests/xxe/disable_xxe_dom_disabled_php8.phpt +++ b/src/tests/xxe/disable_xxe_dom_disabled_php8.phpt @@ -10,6 +10,10 @@ dom --FILE-- WARNING, external entity loaded!'; file_put_contents($dir . '/content.txt', $content); @@ -49,9 +53,3 @@ default setting with LIBXML_NOENT: WARNING, external entity loaded! default setting without LIBXML_NOENT: disabled entity loader with LIBXML_NOENT: WARNING, external entity loaded! disabled entity loader without LIBXML_NOENT: ---CLEAN-- - diff --git a/src/tests/xxe/disable_xxe_dom_php8.phpt b/src/tests/xxe/disable_xxe_dom_php8.phpt index 485828f..133f87e 100644 --- a/src/tests/xxe/disable_xxe_dom_php8.phpt +++ b/src/tests/xxe/disable_xxe_dom_php8.phpt @@ -10,6 +10,11 @@ dom --FILE-- WARNING, external entity loaded!'; file_put_contents($dir . '/content.txt', $content); @@ -48,12 +53,6 @@ printf("disabled entity loader without LIBXML_NOENT: %s\n", $dom->getElementsByT default setting with LIBXML_NOENT: WARNING, external entity loaded! default setting without LIBXML_NOENT: -Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_set_external_entity_loader was tried and nopped in %a.php on line 26 +Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_set_external_entity_loader was tried and nopped in %a.php on line %d disabled entity loader with LIBXML_NOENT: WARNING, external entity loaded! disabled entity loader without LIBXML_NOENT: ---CLEAN-- - -- cgit v1.3