summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorThibault "bui" Koechlin2017-10-18 13:17:46 +0200
committerjvoisin2017-10-18 13:17:46 +0200
commit8f94a1179e9cf9d96f18ec6c851dddbecd54ea6f (patch)
tree970a0cd9f700935e4bd16e73dc630dd3e36554ab /src/tests
parentda49f804ad5ae283c10ad757cd39bcc212b66f88 (diff)
.drop() is not a `nop` anymore
`.drop()` is now baillout out, instead of nop'ing the call. This closes #13
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/disabled_functions.phpt8
-rw-r--r--src/tests/disabled_functions_cidr.phpt2
-rw-r--r--src/tests/disabled_functions_cidr_6.phpt1
-rw-r--r--src/tests/disabled_functions_namespace.phpt3
-rw-r--r--src/tests/disabled_functions_nul_byte.phpt1
-rw-r--r--src/tests/disabled_functions_param.phpt6
-rw-r--r--src/tests/disabled_functions_param_alias.phpt1
-rw-r--r--src/tests/disabled_functions_param_r.phpt1
-rw-r--r--src/tests/disabled_functions_upper.phpt5
-rw-r--r--src/tests/disabled_functions_zero_cidr.phpt1
-rw-r--r--src/tests/dump_request_invalid_folder.phpt1
11 files changed, 2 insertions, 28 deletions
diff --git a/src/tests/disabled_functions.phpt b/src/tests/disabled_functions.phpt
index 1c66ede..de2e4d6 100644
--- a/src/tests/disabled_functions.phpt
+++ b/src/tests/disabled_functions.phpt
@@ -13,9 +13,5 @@ var_dump("this is a super test");
13echo strpos("pouet", "o"); 13echo strpos("pouet", "o");
14?> 14?>
15--EXPECTF-- 15--EXPECTF--
16[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions.php:%d has been disabled. 16[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions.php:2 has been disabled.
17[snuffleupagus][0.0.0.0][disabled_function][simulation] The call to the function 'printf' in %a/tests/disabled_functions.php:%d has been disabled. 17
18printf in simulation mode
19print in disabled mode
20[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'var_dump' in %a/tests/disabled_functions.php:%d has been disabled.
211
diff --git a/src/tests/disabled_functions_cidr.phpt b/src/tests/disabled_functions_cidr.phpt
index 5b13107..ed59fb7 100644
--- a/src/tests/disabled_functions_cidr.phpt
+++ b/src/tests/disabled_functions_cidr.phpt
@@ -11,8 +11,6 @@ sp.configuration_file={PWD}/config/disabled_functions_cidr.ini
11--FILE-- 11--FILE--
12<?php 12<?php
13system("echo 42"); 13system("echo 42");
14printf("1337");
15?> 14?>
16--EXPECTF-- 15--EXPECTF--
17[snuffleupagus][127.0.0.1][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_cidr.php:2 has been disabled. 16[snuffleupagus][127.0.0.1][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_cidr.php:2 has been disabled.
181337
diff --git a/src/tests/disabled_functions_cidr_6.phpt b/src/tests/disabled_functions_cidr_6.phpt
index f2c5f5a..9e5e567 100644
--- a/src/tests/disabled_functions_cidr_6.phpt
+++ b/src/tests/disabled_functions_cidr_6.phpt
@@ -15,4 +15,3 @@ printf(1337);
15?> 15?>
16--EXPECTF-- 16--EXPECTF--
17[snuffleupagus][2001:0db8:0000:0000:0000:ff00:0042:8328][disabled_function][drop] The call to the function 'strpos' in %a/tests/disabled_functions_cidr_6.php:2 has been disabled. 17[snuffleupagus][2001:0db8:0000:0000:0000:ff00:0042:8328][disabled_function][drop] The call to the function 'strpos' in %a/tests/disabled_functions_cidr_6.php:2 has been disabled.
181337
diff --git a/src/tests/disabled_functions_namespace.phpt b/src/tests/disabled_functions_namespace.phpt
index 8934337..24f3b4c 100644
--- a/src/tests/disabled_functions_namespace.phpt
+++ b/src/tests/disabled_functions_namespace.phpt
@@ -28,6 +28,3 @@ my_function();
28?> 28?>
29--EXPECTF-- 29--EXPECTF--
30[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'strcmp' in %a/disabled_functions_namespace.php:%d has been disabled. 30[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'strcmp' in %a/disabled_functions_namespace.php:%d has been disabled.
31[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'my_super_namespace\my_function' in %a/disabled_functions_namespace.php:%d has been disabled.
32Second namespace
33Anonymous namespace
diff --git a/src/tests/disabled_functions_nul_byte.phpt b/src/tests/disabled_functions_nul_byte.phpt
index 95e87de..b4974a9 100644
--- a/src/tests/disabled_functions_nul_byte.phpt
+++ b/src/tests/disabled_functions_nul_byte.phpt
@@ -12,4 +12,3 @@ system("id");
12?> 12?>
13--EXPECTF-- 13--EXPECTF--
14[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_nul_byte.php:2 has been disabled, because its argument 'command' content (0id) matched a rule. 14[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_nul_byte.php:2 has been disabled, because its argument 'command' content (0id) matched a rule.
15[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_nul_byte.php:3 has been disabled, because its argument 'command' content (id) matched a rule. \ No newline at end of file
diff --git a/src/tests/disabled_functions_param.phpt b/src/tests/disabled_functions_param.phpt
index 61521cd..d9f8767 100644
--- a/src/tests/disabled_functions_param.phpt
+++ b/src/tests/disabled_functions_param.phpt
@@ -16,9 +16,3 @@ strncmp("bla", "ble", 2);
16?> 16?>
17--EXPECTF-- 17--EXPECTF--
18[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/disabled_functions_param.php:2 has been disabled, because its argument 'command' content (id) matched the rule '1'. 18[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/disabled_functions_param.php:2 has been disabled, because its argument 'command' content (id) matched the rule '1'.
19win
20int(15)
21[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'shell_exec' in %a/disabled_functions_param.php:5 has been disabled, because its argument 'cmd' content (id) matched the rule '3'.
2242
23[snuffleupagus][0.0.0.0][disabled_function][simulation] The call to the function 'strcmp' in %a/tests/disabled_functions_param.php:7 has been disabled, because its argument 'str1' content (bla) matched the rule '5'.
24[snuffleupagus][0.0.0.0][disabled_function][simulation] The call to the function 'strncmp' in %a/tests/disabled_functions_param.php:8 has been disabled, because its argument 'str1' content (bla) matched a rule.
diff --git a/src/tests/disabled_functions_param_alias.phpt b/src/tests/disabled_functions_param_alias.phpt
index b549d70..e5f9686 100644
--- a/src/tests/disabled_functions_param_alias.phpt
+++ b/src/tests/disabled_functions_param_alias.phpt
@@ -11,4 +11,3 @@ shell_exec("id");
11?> 11?>
12--EXPECTF-- 12--EXPECTF--
13[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_param_alias.php:2 has been disabled, because of the the rule '1'. 13[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_param_alias.php:2 has been disabled, because of the the rule '1'.
14[snuffleupagus][0.0.0.0][disabled_function][simulation] The call to the function 'shell_exec' in %a/tests/disabled_functions_param_alias.php:3 has been disabled, because of the the rule '2'.
diff --git a/src/tests/disabled_functions_param_r.phpt b/src/tests/disabled_functions_param_r.phpt
index 3708881..fbbbf8f 100644
--- a/src/tests/disabled_functions_param_r.phpt
+++ b/src/tests/disabled_functions_param_r.phpt
@@ -11,4 +11,3 @@ system("echo win");
11?> 11?>
12--EXPECTF-- 12--EXPECTF--
13[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_param_r.php:2 has been disabled, because its argument 'command' content (id) matched a rule. 13[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_param_r.php:2 has been disabled, because its argument 'command' content (id) matched a rule.
14win
diff --git a/src/tests/disabled_functions_upper.phpt b/src/tests/disabled_functions_upper.phpt
index 08c26c0..5aa5a8a 100644
--- a/src/tests/disabled_functions_upper.phpt
+++ b/src/tests/disabled_functions_upper.phpt
@@ -14,8 +14,3 @@ echo sTRPOs("pouet", "o");
14?> 14?>
15--EXPECTF-- 15--EXPECTF--
16[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_upper.php:%d has been disabled. 16[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_upper.php:%d has been disabled.
17[snuffleupagus][0.0.0.0][disabled_function][simulation] The call to the function 'printf' in %a/tests/disabled_functions_upper.php:%d has been disabled.
18printf in simulation mode
19print in disabled mode
20[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'var_dump' in %a/tests/disabled_functions_upper.php:%d has been disabled.
211
diff --git a/src/tests/disabled_functions_zero_cidr.phpt b/src/tests/disabled_functions_zero_cidr.phpt
index 35d187a..326d405 100644
--- a/src/tests/disabled_functions_zero_cidr.phpt
+++ b/src/tests/disabled_functions_zero_cidr.phpt
@@ -15,4 +15,3 @@ printf("1337");
15?> 15?>
16--EXPECTF-- 16--EXPECTF--
17[snuffleupagus][127.0.0.1][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_zero_cidr.php:2 has been disabled. 17[snuffleupagus][127.0.0.1][disabled_function][drop] The call to the function 'system' in %a/tests/disabled_functions_zero_cidr.php:2 has been disabled.
181337
diff --git a/src/tests/dump_request_invalid_folder.phpt b/src/tests/dump_request_invalid_folder.phpt
index e7ed45d..f8e3b43 100644
--- a/src/tests/dump_request_invalid_folder.phpt
+++ b/src/tests/dump_request_invalid_folder.phpt
@@ -23,4 +23,3 @@ echo "2\n";
23[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %atests/dump_request_invalid_folder.php:3 has been disabled. 23[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'system' in %atests/dump_request_invalid_folder.php:3 has been disabled.
24[snuffleupagus][0.0.0.0][request_logging][error] Unable to create the folder '/root/NON_EXISTENT/FOLDER/PLEASE/'. 24[snuffleupagus][0.0.0.0][request_logging][error] Unable to create the folder '/root/NON_EXISTENT/FOLDER/PLEASE/'.
25[snuffleupagus][0.0.0.0][request_logging][error] Unable to open /root/NON_EXISTENT/FOLDER/PLEASE/sp_dump_%a_0.0.0.0.dump 25[snuffleupagus][0.0.0.0][request_logging][error] Unable to open /root/NON_EXISTENT/FOLDER/PLEASE/sp_dump_%a_0.0.0.0.dump
262 \ No newline at end of file