summaryrefslogtreecommitdiff
path: root/src/sp_disabled_functions.c
diff options
context:
space:
mode:
authorjvoisin2017-12-21 14:03:18 +0100
committerjvoisin2017-12-21 14:03:18 +0100
commit0d98f51e7dbde4a40c0039910d43ad378eaefa83 (patch)
tree78749747bc46c80f85bc2c3cdfb629b331d200f1 /src/sp_disabled_functions.c
parentf91cf7390c060986e51b77990f4e472165b97dad (diff)
Rename sp_node_t to sp_list_node
Since we now have sp_list and sp_tree, it makes sense to specify that nodes are only for lists.
Diffstat (limited to 'src/sp_disabled_functions.c')
-rw-r--r--src/sp_disabled_functions.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c
index c7974ff..18545c0 100644
--- a/src/sp_disabled_functions.c
+++ b/src/sp_disabled_functions.c
@@ -28,10 +28,10 @@ static char* get_complete_function_path(
28} 28}
29 29
30static bool is_functions_list_matching(zend_execute_data* execute_data, 30static bool is_functions_list_matching(zend_execute_data* execute_data,
31 sp_node_t* functions_list) { 31 sp_list_node* functions_list) {
32 zend_execute_data *orig_execute_data, *current; 32 zend_execute_data *orig_execute_data, *current;
33 orig_execute_data = current = execute_data; 33 orig_execute_data = current = execute_data;
34 sp_node_t* it = functions_list; 34 sp_list_node* it = functions_list;
35 35
36 while (current) { 36 while (current) {
37 if (it == NULL) { // every function in the list matched, we've got a match! 37 if (it == NULL) { // every function in the list matched, we've got a match!
@@ -91,7 +91,7 @@ static bool is_local_var_matching(
91 return false; 91 return false;
92} 92}
93 93
94static const sp_node_t* get_config_node(const char* builtin_name) { 94static const sp_list_node* get_config_node(const char* builtin_name) {
95 if (!builtin_name) { 95 if (!builtin_name) {
96 return SNUFFLEUPAGUS_G(config) 96 return SNUFFLEUPAGUS_G(config)
97 .config_disabled_functions->disabled_functions; 97 .config_disabled_functions->disabled_functions;
@@ -214,7 +214,7 @@ static bool is_param_matching(zend_execute_data* execute_data,
214bool should_disable(zend_execute_data* execute_data, const char* builtin_name, 214bool should_disable(zend_execute_data* execute_data, const char* builtin_name,
215 const char* builtin_param, const char* builtin_param_name) { 215 const char* builtin_param, const char* builtin_param_name) {
216 char current_file_hash[SHA256_SIZE * 2 + 1] = {0}; 216 char current_file_hash[SHA256_SIZE * 2 + 1] = {0};
217 const sp_node_t* config = get_config_node(builtin_name); 217 const sp_list_node* config = get_config_node(builtin_name);
218 char* complete_path_function = get_complete_function_path(execute_data); 218 char* complete_path_function = get_complete_function_path(execute_data);
219 char const* client_ip = getenv("REMOTE_ADDR"); 219 char const* client_ip = getenv("REMOTE_ADDR");
220 const char* current_filename; 220 const char* current_filename;
@@ -341,7 +341,7 @@ allow:
341 341
342static bool should_drop_on_ret(zval* return_value, 342static bool should_drop_on_ret(zval* return_value,
343 const zend_execute_data* const execute_data) { 343 const zend_execute_data* const execute_data) {
344 const sp_node_t* config = 344 const sp_list_node* config =
345 SNUFFLEUPAGUS_G(config).config_disabled_functions_ret->disabled_functions; 345 SNUFFLEUPAGUS_G(config).config_disabled_functions_ret->disabled_functions;
346 char* complete_path_function = get_complete_function_path(execute_data); 346 char* complete_path_function = get_complete_function_path(execute_data);
347 const char* current_filename = zend_get_executed_filename(TSRMLS_C); 347 const char* current_filename = zend_get_executed_filename(TSRMLS_C);
@@ -445,7 +445,7 @@ ZEND_FUNCTION(check_disabled_function) {
445 } 445 }
446} 446}
447 447
448static int hook_functions(const sp_node_t* config) { 448static int hook_functions(const sp_list_node* config) {
449 while (config && config->data) { 449 while (config && config->data) {
450 const char* function_name = ((sp_disabled_function*)config->data)->function; 450 const char* function_name = ((sp_disabled_function*)config->data)->function;
451 const pcre* function_name_regexp = 451 const pcre* function_name_regexp =