summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorjvoisin2023-01-04 19:06:28 +0100
committerjvoisin2023-01-04 19:10:38 +0100
commit1bf0f3ec9088d34383c564d6306901ae6dc94cb5 (patch)
treed484c173bacd0e5c5d2847b43f99e99d26074019 /src/tests
parent0423e1b63364f4dd741d3a8ac8a880407ff37371 (diff)
Fix the CI for PHP8.2
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/deny_writable/deny_writable_execution.phpt10
-rw-r--r--src/tests/deny_writable/deny_writable_execution_simulation.phpt20
-rw-r--r--src/tests/deny_writable/dump_deny_writable_execution.phpt10
-rw-r--r--src/tests/disable_function/disabled_function_echo.phpt1
-rw-r--r--src/tests/disable_function/disabled_function_echo_2.phpt1
-rw-r--r--src/tests/disable_function/disabled_function_echo_local_var.phpt1
-rw-r--r--src/tests/disable_function/disabled_function_print.phpt3
-rw-r--r--src/tests/xxe/disable_xxe_dom_disabled.phpt9
-rw-r--r--src/tests/xxe/disable_xxe_simplexml.phpt9
-rw-r--r--src/tests/xxe/disable_xxe_simplexml_oop.phpt9
-rw-r--r--src/tests/xxe/disable_xxe_xml_parse.phpt13
11 files changed, 26 insertions, 60 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);
31include "$dir/non_writable_file.txt"; 33include "$dir/non_writable_file.txt";
32include "$dir/writable_file.txt"; 34include "$dir/writable_file.txt";
33?> 35?>
34--CLEAN--
35<?php
36$dir = __DIR__;
37chmod("$dir/non_writable_file.txt", 0777);
38chmod("$dir/writable_file.txt", 0777);
39unlink("$dir/non_writable_file.txt");
40unlink("$dir/writable_file.txt");
41?>
42--EXPECTF-- 36--EXPECTF--
43Fatal 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 37Fatal 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);
32include "$dir/writable_file.txt"; 34include "$dir/writable_file.txt";
33include "$dir/non_writable_file.txt"; 35include "$dir/non_writable_file.txt";
34?> 36?>
35--CLEAN--
36<?php
37$dir = __DIR__;
38chmod("$dir/non_writable_file.txt", 0777);
39chmod("$dir/writable_file.txt", 0777);
40unlink("$dir/non_writable_file.txt");
41unlink("$dir/writable_file.txt");
42?>
43--EXPECTF-- 37--EXPECTF--
44Warning: [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 38Warning: [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
46Warning: [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 40Warning: [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
48Warning: [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 42Warning: [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
49Code execution within a writable file. 43Code execution within a writable file.
50 44
51Warning: [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 45Warning: [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
53Warning: [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 47Warning: [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
54Code execution within a non-writable file. 48Code 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
59WIN 61WIN
60--CLEAN--
61<?php
62$dir = __DIR__;
63chmod("$dir/non_writable_file.txt", 0777);
64chmod("$dir/writable_file.txt", 0777);
65unlink("$dir/non_writable_file.txt");
66unlink("$dir/writable_file.txt");
67?>
diff --git a/src/tests/disable_function/disabled_function_echo.phpt b/src/tests/disable_function/disabled_function_echo.phpt
index 12aaff4..b1da0dc 100644
--- a/src/tests/disable_function/disabled_function_echo.phpt
+++ b/src/tests/disable_function/disabled_function_echo.phpt
@@ -13,7 +13,6 @@ echo "qwe";
13test("rty"); 13test("rty");
14test("oops"); 14test("oops");
15?> 15?>
16--CLEAN--
17--EXPECTF-- 16--EXPECTF--
18qwerty 17qwerty
19Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_echo.php on line 3 18Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_echo.php on line 3
diff --git a/src/tests/disable_function/disabled_function_echo_2.phpt b/src/tests/disable_function/disabled_function_echo_2.phpt
index 82a2fa1..c1d9817 100644
--- a/src/tests/disable_function/disabled_function_echo_2.phpt
+++ b/src/tests/disable_function/disabled_function_echo_2.phpt
@@ -9,7 +9,6 @@ sp.configuration_file={PWD}/config/disabled_function_echo.ini
9echo "qwe"; 9echo "qwe";
10echo "1", "oops"; 10echo "1", "oops";
11?> 11?>
12--CLEAN--
13--EXPECTF-- 12--EXPECTF--
14qwe1 13qwe1
15Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_echo_2.php on line 3 14Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_echo_2.php on line 3
diff --git a/src/tests/disable_function/disabled_function_echo_local_var.phpt b/src/tests/disable_function/disabled_function_echo_local_var.phpt
index ee1be1f..52d1f48 100644
--- a/src/tests/disable_function/disabled_function_echo_local_var.phpt
+++ b/src/tests/disable_function/disabled_function_echo_local_var.phpt
@@ -14,7 +14,6 @@ test();
14$abc = 123; 14$abc = 123;
15test(); 15test();
16?> 16?>
17--CLEAN--
18--EXPECTF-- 17--EXPECTF--
193 183
20 19
diff --git a/src/tests/disable_function/disabled_function_print.phpt b/src/tests/disable_function/disabled_function_print.phpt
index ec1b04f..9600854 100644
--- a/src/tests/disable_function/disabled_function_print.phpt
+++ b/src/tests/disable_function/disabled_function_print.phpt
@@ -13,7 +13,6 @@ print "qwe";
13test("rty"); 13test("rty");
14test("oops"); 14test("oops");
15?> 15?>
16--CLEAN--
17--EXPECTF-- 16--EXPECTF--
18qwerty 17qwerty
19Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_print.php on line 3 \ No newline at end of file 18Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_print.php on line 3
diff --git a/src/tests/xxe/disable_xxe_dom_disabled.phpt b/src/tests/xxe/disable_xxe_dom_disabled.phpt
index 4a888ed..20399ec 100644
--- a/src/tests/xxe/disable_xxe_dom_disabled.phpt
+++ b/src/tests/xxe/disable_xxe_dom_disabled.phpt
@@ -10,6 +10,9 @@ dom
10--FILE-- 10--FILE--
11<?php 11<?php
12$dir = __DIR__; 12$dir = __DIR__;
13@unlink($dir . "/content.xml");
14@unlink($dir . "/content.txt");
15
13$content = '<content>WARNING, external entity loaded!</content>'; 16$content = '<content>WARNING, external entity loaded!</content>';
14file_put_contents($dir . '/content.txt', $content); 17file_put_contents($dir . '/content.txt', $content);
15 18
@@ -52,9 +55,3 @@ libxml_disable_entity to false: WARNING, external entity loaded!
52 55
53Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %s/tests/xxe/disable_xxe_dom_disabled.php on line %d 56Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %s/tests/xxe/disable_xxe_dom_disabled.php on line %d
54without xxe: foo 57without xxe: foo
55--CLEAN--
56<?php
57$dir = __DIR__;
58unlink($dir . "/content.xml");
59unlink($dir . "/content.txt");
60?>
diff --git a/src/tests/xxe/disable_xxe_simplexml.phpt b/src/tests/xxe/disable_xxe_simplexml.phpt
index 9560156..8a4f033 100644
--- a/src/tests/xxe/disable_xxe_simplexml.phpt
+++ b/src/tests/xxe/disable_xxe_simplexml.phpt
@@ -11,6 +11,9 @@ simplexml
11--FILE-- 11--FILE--
12<?php 12<?php
13$dir = __DIR__; 13$dir = __DIR__;
14@unlink($dir . "/content.xml");
15@unlink($dir . "/content.txt");
16
14$content = 'WARNING, external entity loaded!'; 17$content = 'WARNING, external entity loaded!';
15file_put_contents('content.txt', $content); 18file_put_contents('content.txt', $content);
16 19
@@ -44,9 +47,3 @@ printf("without xxe: %s", $doc->testing);
44libxml_disable_entity to true: 47libxml_disable_entity to true:
45libxml_disable_entity to false: 48libxml_disable_entity to false:
46without xxe: foo 49without xxe: foo
47--CLEAN--
48<?php
49$dir = __DIR__;
50unlink($dir . "/content.xml");
51unlink($dir . "/content.txt");
52?>
diff --git a/src/tests/xxe/disable_xxe_simplexml_oop.phpt b/src/tests/xxe/disable_xxe_simplexml_oop.phpt
index 1b2c4ca..c28c364 100644
--- a/src/tests/xxe/disable_xxe_simplexml_oop.phpt
+++ b/src/tests/xxe/disable_xxe_simplexml_oop.phpt
@@ -11,6 +11,9 @@ simplexml
11--FILE-- 11--FILE--
12<?php 12<?php
13$dir = __DIR__; 13$dir = __DIR__;
14@unlink($dir . "/content.xml");
15@unlink($dir . "/content.txt");
16
14$content = 'WARNING, external entity loaded!'; 17$content = 'WARNING, external entity loaded!';
15file_put_contents('content.txt', $content); 18file_put_contents('content.txt', $content);
16 19
@@ -44,9 +47,3 @@ printf("without xxe: %s", $doc->testing);
44libxml_disable_entity to true: 47libxml_disable_entity to true:
45libxml_disable_entity to false: 48libxml_disable_entity to false:
46without xxe: foo 49without xxe: foo
47--CLEAN--
48<?php
49$dir = __DIR__;
50unlink($dir . "/content.xml");
51unlink($dir . "/content.txt");
52?>
diff --git a/src/tests/xxe/disable_xxe_xml_parse.phpt b/src/tests/xxe/disable_xxe_xml_parse.phpt
index bc7e338..4a8292d 100644
--- a/src/tests/xxe/disable_xxe_xml_parse.phpt
+++ b/src/tests/xxe/disable_xxe_xml_parse.phpt
@@ -16,6 +16,9 @@ sp.configuration_file={PWD}/config/disable_xxe.ini
16--FILE-- 16--FILE--
17<?php 17<?php
18$dir = __DIR__; 18$dir = __DIR__;
19@unlink($dir . "/content.xml");
20@unlink($dir . "/content.txt");
21
19$content = 'WARNING, external entity loaded!'; 22$content = 'WARNING, external entity loaded!';
20file_put_contents('content.txt', $content); 23file_put_contents('content.txt', $content);
21 24
@@ -71,7 +74,7 @@ $doc = xml_parse($parser, $xml, true);
71xml_parser_free($parser); 74xml_parser_free($parser);
72 75
73--EXPECTF-- 76--EXPECTF--
74Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line 41 77Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line %d
75string(4) "TEST" 78string(4) "TEST"
76 79
77array(0) { 80array(0) {
@@ -83,7 +86,7 @@ array(0) {
83string(7) "TESTING" 86string(7) "TESTING"
84string(4) "TEST" 87string(4) "TEST"
85 88
86Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line 46 89Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line %d
87string(4) "TEST" 90string(4) "TEST"
88 91
89array(0) { 92array(0) {
@@ -104,9 +107,3 @@ array(0) {
104} 107}
105textfoostring(7) "TESTING" 108textfoostring(7) "TESTING"
106string(4) "TEST" 109string(4) "TEST"
107--CLEAN--
108<?php
109$dir = __DIR__;
110unlink($dir . "/content.xml");
111unlink($dir . "/content.txt");
112?>