diff options
| author | jvoisin | 2023-01-04 19:06:28 +0100 |
|---|---|---|
| committer | jvoisin | 2023-01-04 19:10:38 +0100 |
| commit | 1bf0f3ec9088d34383c564d6306901ae6dc94cb5 (patch) | |
| tree | d484c173bacd0e5c5d2847b43f99e99d26074019 /src/tests/deny_writable | |
| parent | 0423e1b63364f4dd741d3a8ac8a880407ff37371 (diff) | |
Fix the CI for PHP8.2
Diffstat (limited to 'src/tests/deny_writable')
3 files changed, 11 insertions, 29 deletions
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 | |||
| 21 | $dir = __DIR__; | 21 | $dir = __DIR__; |
| 22 | 22 | ||
| 23 | // just in case | 23 | // just in case |
| 24 | @chmod("$dir/non_writable_file.txt", 0777); | ||
| 25 | @chmod("$dir/writable_file.txt", 0777); | ||
| 24 | @unlink("$dir/non_writable_file.txt"); | 26 | @unlink("$dir/non_writable_file.txt"); |
| 25 | @unlink("$dir/writable_file.txt"); | 27 | @unlink("$dir/writable_file.txt"); |
| 26 | 28 | ||
| @@ -31,13 +33,5 @@ chmod("$dir/writable_file.txt", 0777); | |||
| 31 | include "$dir/non_writable_file.txt"; | 33 | include "$dir/non_writable_file.txt"; |
| 32 | include "$dir/writable_file.txt"; | 34 | include "$dir/writable_file.txt"; |
| 33 | ?> | 35 | ?> |
| 34 | --CLEAN-- | ||
| 35 | <?php | ||
| 36 | $dir = __DIR__; | ||
| 37 | chmod("$dir/non_writable_file.txt", 0777); | ||
| 38 | chmod("$dir/writable_file.txt", 0777); | ||
| 39 | unlink("$dir/non_writable_file.txt"); | ||
| 40 | unlink("$dir/writable_file.txt"); | ||
| 41 | ?> | ||
| 42 | --EXPECTF-- | 36 | --EXPECTF-- |
| 43 | 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 | 37 | 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 | |||
| 22 | $dir = __DIR__; | 22 | $dir = __DIR__; |
| 23 | 23 | ||
| 24 | // just in case | 24 | // just in case |
| 25 | @chmod("$dir/non_writable_file.txt", 0777); | ||
| 26 | @chmod("$dir/writable_file.txt", 0777); | ||
| 25 | @unlink("$dir/non_writable_file.txt"); | 27 | @unlink("$dir/non_writable_file.txt"); |
| 26 | @unlink("$dir/writable_file.txt"); | 28 | @unlink("$dir/writable_file.txt"); |
| 27 | 29 | ||
| @@ -32,23 +34,15 @@ chmod("$dir/non_writable_file.txt", 0400); | |||
| 32 | include "$dir/writable_file.txt"; | 34 | include "$dir/writable_file.txt"; |
| 33 | include "$dir/non_writable_file.txt"; | 35 | include "$dir/non_writable_file.txt"; |
| 34 | ?> | 36 | ?> |
| 35 | --CLEAN-- | ||
| 36 | <?php | ||
| 37 | $dir = __DIR__; | ||
| 38 | chmod("$dir/non_writable_file.txt", 0777); | ||
| 39 | chmod("$dir/writable_file.txt", 0777); | ||
| 40 | unlink("$dir/non_writable_file.txt"); | ||
| 41 | unlink("$dir/writable_file.txt"); | ||
| 42 | ?> | ||
| 43 | --EXPECTF-- | 37 | --EXPECTF-- |
| 44 | 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 | 38 | 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 |
| 45 | 39 | ||
| 46 | 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 | 40 | 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 |
| 47 | 41 | ||
| 48 | 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 | 42 | 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 |
| 49 | Code execution within a writable file. | 43 | Code execution within a writable file. |
| 50 | 44 | ||
| 51 | 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 | 45 | 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 |
| 52 | 46 | ||
| 53 | 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 | 47 | 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 |
| 54 | Code execution within a non-writable file. | 48 | 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) { | |||
| 32 | $dir = __DIR__; | 32 | $dir = __DIR__; |
| 33 | 33 | ||
| 34 | // just in case | 34 | // just in case |
| 35 | @chmod("$dir/non_writable_file.txt", 0777); | ||
| 36 | @chmod("$dir/writable_file.txt", 0777); | ||
| 35 | @unlink("$dir/non_writable_file.txt"); | 37 | @unlink("$dir/non_writable_file.txt"); |
| 36 | @unlink("$dir/writable_file.txt"); | 38 | @unlink("$dir/writable_file.txt"); |
| 37 | 39 | ||
| @@ -57,11 +59,3 @@ if ($res[2] != "GET:get_a='data_get_a_readonly' get_b='data_get_b_readonly' \n") | |||
| 57 | --EXPECTF-- | 59 | --EXPECTF-- |
| 58 | %a | 60 | %a |
| 59 | WIN | 61 | WIN |
| 60 | --CLEAN-- | ||
| 61 | <?php | ||
| 62 | $dir = __DIR__; | ||
| 63 | chmod("$dir/non_writable_file.txt", 0777); | ||
| 64 | chmod("$dir/writable_file.txt", 0777); | ||
| 65 | unlink("$dir/non_writable_file.txt"); | ||
| 66 | unlink("$dir/writable_file.txt"); | ||
| 67 | ?> | ||
