diff options
| author | jvoisin | 2022-03-20 18:20:45 +0100 |
|---|---|---|
| committer | jvoisin | 2022-03-20 18:20:45 +0100 |
| commit | 81dd7f2ef07af306fe83d7755cbac4529aa9fc8d (patch) | |
| tree | 32cc44c6231b30db5ac7b15699297863460784aa /src/php_snuffleupagus.h | |
| parent | 83b01942dfc80474cc05e09aeef4b44307a7120b (diff) | |
| parent | c38df1077a6c1dfbca1baca049214d053e2e7684 (diff) | |
Merge remote-tracking branch 'sektioneins/master'
Diffstat (limited to 'src/php_snuffleupagus.h')
| -rw-r--r-- | src/php_snuffleupagus.h | 51 |
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 | ||
| 89 | extern zend_module_entry snuffleupagus_module_entry; | 93 | extern 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 | ||
| 104 | ZEND_BEGIN_MODULE_GLOBALS(snuffleupagus) | 108 | ZEND_BEGIN_MODULE_GLOBALS(snuffleupagus) |
| 105 | size_t in_eval; | 109 | // sp_config config; |
| 106 | sp_config config; | 110 | // --- snuffleupagus config |
| 107 | int is_config_valid; // 1 = valid, 0 = invalid, -1 = none | 111 | sp_config_random config_random; |
| 112 | sp_config_sloppy config_sloppy; | ||
| 113 | sp_config_unserialize config_unserialize; | ||
| 114 | sp_config_readonly_exec config_readonly_exec; | ||
| 115 | sp_config_upload_validation config_upload_validation; | ||
| 116 | sp_config_cookie config_cookie; | ||
| 117 | sp_config_auto_cookie_secure config_auto_cookie_secure; | ||
| 118 | sp_config_global_strict config_global_strict; | ||
| 119 | sp_config_xxe_protection config_xxe_protection; | ||
| 120 | sp_config_eval config_eval; | ||
| 121 | sp_config_wrapper config_wrapper; | ||
| 122 | sp_config_session config_session; | ||
| 123 | sp_config_ini config_ini; | ||
| 124 | char config_log_media; | ||
| 125 | u_long config_max_execution_depth; | ||
| 126 | bool config_server_encode; | ||
| 127 | bool config_server_strip; | ||
| 128 | zend_string *config_encryption_key; | ||
| 129 | zend_string *config_cookies_env_var; | ||
| 130 | bool config_show_old_php_warning; | ||
| 131 | |||
| 132 | HashTable *config_disabled_functions; | ||
| 133 | HashTable *config_disabled_functions_hooked; | ||
| 134 | HashTable *config_disabled_functions_ret; | ||
| 135 | HashTable *config_disabled_functions_ret_hooked; | ||
| 136 | sp_config_disabled_functions config_disabled_functions_reg; | ||
| 137 | sp_config_disabled_functions config_disabled_functions_reg_ret; | ||
| 138 | |||
| 139 | bool hook_execute; | ||
| 140 | |||
| 141 | // --- ini options | ||
| 108 | bool allow_broken_configuration; | 142 | bool allow_broken_configuration; |
| 143 | |||
| 144 | // --- runtime/state variables | ||
| 145 | int is_config_valid; // 1 = valid, 0 = invalid, -1 = none | ||
| 146 | size_t in_eval; | ||
| 147 | u_long execution_depth; | ||
| 109 | HashTable *disabled_functions_hook; | 148 | HashTable *disabled_functions_hook; |
| 110 | HashTable *sp_internal_functions_hook; | 149 | HashTable *sp_internal_functions_hook; |
| 111 | HashTable *sp_eval_blacklist_functions_hook; | 150 | HashTable *sp_eval_blacklist_functions_hook; |
| @@ -113,6 +152,8 @@ ZEND_END_MODULE_GLOBALS(snuffleupagus) | |||
| 113 | 152 | ||
| 114 | ZEND_EXTERN_MODULE_GLOBALS(snuffleupagus) | 153 | ZEND_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) |
| 118 | ZEND_TSRMLS_CACHE_EXTERN() | 159 | ZEND_TSRMLS_CACHE_EXTERN() |
