summaryrefslogtreecommitdiff
path: root/src/php_snuffleupagus.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/php_snuffleupagus.h')
-rw-r--r--src/php_snuffleupagus.h51
1 files changed, 46 insertions, 5 deletions
diff --git a/src/php_snuffleupagus.h b/src/php_snuffleupagus.h
index 9ed67e6..8dc7ccb 100644
--- a/src/php_snuffleupagus.h
+++ b/src/php_snuffleupagus.h
@@ -1,9 +1,9 @@
1#ifndef PHP_SNUFFLEUPAGUS_H 1#ifndef PHP_SNUFFLEUPAGUS_H
2#define PHP_SNUFFLEUPAGUS_H 2#define PHP_SNUFFLEUPAGUS_H
3 3
4#define PHP_SNUFFLEUPAGUS_VERSION "0.7.1" 4#define PHP_SNUFFLEUPAGUS_VERSION "0.8.0"
5#define PHP_SNUFFLEUPAGUS_EXTNAME "snuffleupagus" 5#define PHP_SNUFFLEUPAGUS_EXTNAME "snuffleupagus"
6#define PHP_SNUFFLEUPAGUS_AUTHOR "NBS System & Julien (jvoisin) Voisin" 6#define PHP_SNUFFLEUPAGUS_AUTHOR "NBS System & Julien (jvoisin) Voisin & SektionEins GmbH"
7#define PHP_SNUFFLEUPAGUS_URL "https://github.com/jvoisin/snuffleupagus" 7#define PHP_SNUFFLEUPAGUS_URL "https://github.com/jvoisin/snuffleupagus"
8#define PHP_SNUFFLEUPAGUS_COPYRIGHT "LGPLv2" 8#define PHP_SNUFFLEUPAGUS_COPYRIGHT "LGPLv2"
9 9
@@ -65,10 +65,12 @@ typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
65#define SP_CONFIG_INVALID 0 65#define SP_CONFIG_INVALID 0
66#define SP_CONFIG_NONE -1 66#define SP_CONFIG_NONE -1
67 67
68#include "sp_php_compat.h"
68#include "sp_pcre_compat.h" 69#include "sp_pcre_compat.h"
69#include "sp_list.h" 70#include "sp_list.h"
70#include "sp_tree.h" 71#include "sp_tree.h"
71#include "sp_var_parser.h" 72#include "sp_var_parser.h"
73#include "sp_config_scanner.h"
72#include "sp_config.h" 74#include "sp_config.h"
73#include "sp_config_utils.h" 75#include "sp_config_utils.h"
74#include "sp_config_keywords.h" 76#include "sp_config_keywords.h"
@@ -85,6 +87,8 @@ typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
85#include "sp_session.h" 87#include "sp_session.h"
86#include "sp_sloppy.h" 88#include "sp_sloppy.h"
87#include "sp_wrapper.h" 89#include "sp_wrapper.h"
90#include "sp_ini.h"
91#include "sp_ifilter.h"
88 92
89extern zend_module_entry snuffleupagus_module_entry; 93extern zend_module_entry snuffleupagus_module_entry;
90#define phpext_snuffleupagus_ptr &snuffleupagus_module_entry 94#define phpext_snuffleupagus_ptr &snuffleupagus_module_entry
@@ -102,10 +106,45 @@ extern zend_module_entry snuffleupagus_module_entry;
102#endif 106#endif
103 107
104ZEND_BEGIN_MODULE_GLOBALS(snuffleupagus) 108ZEND_BEGIN_MODULE_GLOBALS(snuffleupagus)
105size_t in_eval; 109// sp_config config;
106sp_config config; 110// --- snuffleupagus config
107int is_config_valid; // 1 = valid, 0 = invalid, -1 = none 111sp_config_random config_random;
112sp_config_sloppy config_sloppy;
113sp_config_unserialize config_unserialize;
114sp_config_readonly_exec config_readonly_exec;
115sp_config_upload_validation config_upload_validation;
116sp_config_cookie config_cookie;
117sp_config_auto_cookie_secure config_auto_cookie_secure;
118sp_config_global_strict config_global_strict;
119sp_config_xxe_protection config_xxe_protection;
120sp_config_eval config_eval;
121sp_config_wrapper config_wrapper;
122sp_config_session config_session;
123sp_config_ini config_ini;
124char config_log_media;
125u_long config_max_execution_depth;
126bool config_server_encode;
127bool config_server_strip;
128zend_string *config_encryption_key;
129zend_string *config_cookies_env_var;
130bool config_show_old_php_warning;
131
132HashTable *config_disabled_functions;
133HashTable *config_disabled_functions_hooked;
134HashTable *config_disabled_functions_ret;
135HashTable *config_disabled_functions_ret_hooked;
136sp_config_disabled_functions config_disabled_functions_reg;
137sp_config_disabled_functions config_disabled_functions_reg_ret;
138
139bool hook_execute;
140
141// --- ini options
108bool allow_broken_configuration; 142bool allow_broken_configuration;
143
144// --- runtime/state variables
145int is_config_valid; // 1 = valid, 0 = invalid, -1 = none
146size_t in_eval;
147u_long execution_depth;
109HashTable *disabled_functions_hook; 148HashTable *disabled_functions_hook;
110HashTable *sp_internal_functions_hook; 149HashTable *sp_internal_functions_hook;
111HashTable *sp_eval_blacklist_functions_hook; 150HashTable *sp_eval_blacklist_functions_hook;
@@ -113,6 +152,8 @@ ZEND_END_MODULE_GLOBALS(snuffleupagus)
113 152
114ZEND_EXTERN_MODULE_GLOBALS(snuffleupagus) 153ZEND_EXTERN_MODULE_GLOBALS(snuffleupagus)
115#define SNUFFLEUPAGUS_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(snuffleupagus, v) 154#define SNUFFLEUPAGUS_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(snuffleupagus, v)
155#define SPG(v) SNUFFLEUPAGUS_G(v)
156#define SPCFG(v) SPG(config_##v)
116 157
117#if defined(ZTS) && defined(COMPILE_DL_SNUFFLEUPAGUS) 158#if defined(ZTS) && defined(COMPILE_DL_SNUFFLEUPAGUS)
118ZEND_TSRMLS_CACHE_EXTERN() 159ZEND_TSRMLS_CACHE_EXTERN()