From 1bf0f3ec9088d34383c564d6306901ae6dc94cb5 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 4 Jan 2023 19:06:28 +0100 Subject: Fix the CI for PHP8.2 --- src/tests/deny_writable/deny_writable_execution.phpt | 10 ++-------- .../deny_writable_execution_simulation.phpt | 20 +++++++------------- .../deny_writable/dump_deny_writable_execution.phpt | 10 ++-------- 3 files changed, 11 insertions(+), 29 deletions(-) (limited to 'src/tests/deny_writable') diff --git a/src/tests/deny_writable/deny_writable_execution.phpt b/src/tests/deny_writable/deny_writable_execution.phpt index a629479..383ffa5 100644 --- a/src/tests/deny_writable/deny_writable_execution.phpt +++ b/src/tests/deny_writable/deny_writable_execution.phpt @@ -21,6 +21,8 @@ sp.configuration_file={PWD}/config/config_disable_writable.ini $dir = __DIR__; // just in case +@chmod("$dir/non_writable_file.txt", 0777); +@chmod("$dir/writable_file.txt", 0777); @unlink("$dir/non_writable_file.txt"); @unlink("$dir/writable_file.txt"); @@ -31,13 +33,5 @@ chmod("$dir/writable_file.txt", 0777); include "$dir/non_writable_file.txt"; include "$dir/writable_file.txt"; ?> ---CLEAN-- - --EXPECTF-- Fatal error: [snuffleupagus][0.0.0.0][readonly_exec][drop] Attempted execution of a writable file (%a/deny_writable_execution.php) in %a/deny_writable_execution.php on line 2 diff --git a/src/tests/deny_writable/deny_writable_execution_simulation.phpt b/src/tests/deny_writable/deny_writable_execution_simulation.phpt index d4e4801..39dab32 100644 --- a/src/tests/deny_writable/deny_writable_execution_simulation.phpt +++ b/src/tests/deny_writable/deny_writable_execution_simulation.phpt @@ -22,6 +22,8 @@ sp.configuration_file={PWD}/config/config_disable_writable_simulation.ini $dir = __DIR__; // just in case +@chmod("$dir/non_writable_file.txt", 0777); +@chmod("$dir/writable_file.txt", 0777); @unlink("$dir/non_writable_file.txt"); @unlink("$dir/writable_file.txt"); @@ -32,23 +34,15 @@ chmod("$dir/non_writable_file.txt", 0400); include "$dir/writable_file.txt"; include "$dir/non_writable_file.txt"; ?> ---CLEAN-- - --EXPECTF-- -Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/deny_writable_execution_simulation.php) in %a/deny_writable_execution_simulation.php on line 2 +Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/deny_writable_execution_simulation.php) in %a/deny_writable_execution_simulation.php on line %d -Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/writable_file.txt) in %a/deny_writable_execution_simulation.php on line 12 +Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/writable_file.txt) in %a/deny_writable_execution_simulation.php on line %d -Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/writable_file.txt) in %a/writable_file.txt on line 1 +Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/writable_file.txt) in %a/writable_file.txt on line %d Code execution within a writable file. -Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a file owned by the PHP process (%s/tests/deny_writable/non_writable_file.txt) in %s/tests/deny_writable/deny_writable_execution_simulation.php on line 13 +Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a file owned by the PHP process (%s/tests/deny_writable/non_writable_file.txt) in %s/tests/deny_writable/deny_writable_execution_simulation.php on line %d -Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a file owned by the PHP process (%s/tests/deny_writable/non_writable_file.txt) in %src/tests/deny_writable/non_writable_file.txt on line 1 +Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a file owned by the PHP process (%s/tests/deny_writable/non_writable_file.txt) in %src/tests/deny_writable/non_writable_file.txt on line %d Code execution within a non-writable file. diff --git a/src/tests/deny_writable/dump_deny_writable_execution.phpt b/src/tests/deny_writable/dump_deny_writable_execution.phpt index c6dd6cd..2e6bca5 100644 --- a/src/tests/deny_writable/dump_deny_writable_execution.phpt +++ b/src/tests/deny_writable/dump_deny_writable_execution.phpt @@ -32,6 +32,8 @@ foreach (glob("/tmp/dump_result/sp_dump.*") as $dump) { $dir = __DIR__; // just in case +@chmod("$dir/non_writable_file.txt", 0777); +@chmod("$dir/writable_file.txt", 0777); @unlink("$dir/non_writable_file.txt"); @unlink("$dir/writable_file.txt"); @@ -57,11 +59,3 @@ if ($res[2] != "GET:get_a='data_get_a_readonly' get_b='data_get_b_readonly' \n") --EXPECTF-- %a WIN ---CLEAN-- - -- cgit v1.3