diff options
| author | Stefan Esser | 2015-12-17 16:35:34 +0100 |
|---|---|---|
| committer | Stefan Esser | 2015-12-17 16:35:34 +0100 |
| commit | c4c9192839ba7842f5da58f5fd525056c77cfe54 (patch) | |
| tree | 810854ddb53e03d7320570ec8d634390a849d6b2 /php_suhosin7.h | |
| parent | aee7faf18880573b60606756a61faea32a1bb89a (diff) | |
Continue the actual porting work on GitHub
Diffstat (limited to 'php_suhosin7.h')
| -rw-r--r-- | php_suhosin7.h | 191 |
1 files changed, 191 insertions, 0 deletions
diff --git a/php_suhosin7.h b/php_suhosin7.h new file mode 100644 index 0000000..805701e --- /dev/null +++ b/php_suhosin7.h | |||
| @@ -0,0 +1,191 @@ | |||
| 1 | /* | ||
| 2 | +----------------------------------------------------------------------+ | ||
| 3 | | PHP Version 7 | | ||
| 4 | +----------------------------------------------------------------------+ | ||
| 5 | | Copyright (c) 1997-2015 The PHP Group | | ||
| 6 | +----------------------------------------------------------------------+ | ||
| 7 | | This source file is subject to version 3.01 of the PHP license, | | ||
| 8 | | that is bundled with this package in the file LICENSE, and is | | ||
| 9 | | available through the world-wide-web at the following url: | | ||
| 10 | | http://www.php.net/license/3_01.txt | | ||
| 11 | | If you did not receive a copy of the PHP license and are unable to | | ||
| 12 | | obtain it through the world-wide-web, please send a note to | | ||
| 13 | | license@php.net so we can mail you a copy immediately. | | ||
| 14 | +----------------------------------------------------------------------+ | ||
| 15 | | Author: | | ||
| 16 | +----------------------------------------------------------------------+ | ||
| 17 | */ | ||
| 18 | |||
| 19 | /* $Id$ */ | ||
| 20 | |||
| 21 | #ifndef PHP_SUHOSIN7_H | ||
| 22 | #define PHP_SUHOSIN7_H | ||
| 23 | |||
| 24 | extern zend_module_entry suhosin7_module_entry; | ||
| 25 | #define phpext_suhosin7_ptr &suhosin7_module_entry | ||
| 26 | |||
| 27 | #define SUHOSIN7_EXT_VERSION "0.10.0" | ||
| 28 | |||
| 29 | #ifdef PHP_WIN32 | ||
| 30 | # define PHP_SUHOSIN7_API __declspec(dllexport) | ||
| 31 | #elif defined(__GNUC__) && __GNUC__ >= 4 | ||
| 32 | # define PHP_SUHOSIN7_API __attribute__ ((visibility("default"))) | ||
| 33 | #else | ||
| 34 | # define PHP_SUHOSIN7_API | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #ifdef ZTS | ||
| 38 | #include "TSRM.h" | ||
| 39 | #endif | ||
| 40 | |||
| 41 | #define BYTE unsigned char /* 8 bits */ | ||
| 42 | #define WORD unsigned int /* 32 bits */ | ||
| 43 | |||
| 44 | ZEND_BEGIN_MODULE_GLOBALS(suhosin7) | ||
| 45 | zend_long global_value; | ||
| 46 | char *global_string; | ||
| 47 | zend_bool protectkey; | ||
| 48 | |||
| 49 | zend_bool simulation; | ||
| 50 | zend_bool already_scanned; | ||
| 51 | zend_bool abort_request; | ||
| 52 | |||
| 53 | /* request variables */ | ||
| 54 | zend_long max_request_variables; | ||
| 55 | zend_long cur_request_variables; | ||
| 56 | zend_long att_request_variables; | ||
| 57 | zend_long max_varname_length; | ||
| 58 | zend_long max_totalname_length; | ||
| 59 | zend_long max_value_length; | ||
| 60 | zend_long max_array_depth; | ||
| 61 | zend_long max_array_index_length; | ||
| 62 | char* array_index_whitelist; | ||
| 63 | char* array_index_blacklist; | ||
| 64 | zend_bool disallow_nul; | ||
| 65 | zend_bool disallow_ws; | ||
| 66 | /* cookie variables */ | ||
| 67 | zend_long max_cookie_vars; | ||
| 68 | zend_long cur_cookie_vars; | ||
| 69 | zend_long att_cookie_vars; | ||
| 70 | zend_long max_cookie_name_length; | ||
| 71 | zend_long max_cookie_totalname_length; | ||
| 72 | zend_long max_cookie_value_length; | ||
| 73 | zend_long max_cookie_array_depth; | ||
| 74 | zend_long max_cookie_array_index_length; | ||
| 75 | zend_bool disallow_cookie_nul; | ||
| 76 | zend_bool disallow_cookie_ws; | ||
| 77 | /* get variables */ | ||
| 78 | zend_long max_get_vars; | ||
| 79 | zend_long cur_get_vars; | ||
| 80 | zend_long att_get_vars; | ||
| 81 | zend_long max_get_name_length; | ||
| 82 | zend_long max_get_totalname_length; | ||
| 83 | zend_long max_get_value_length; | ||
| 84 | zend_long max_get_array_depth; | ||
| 85 | zend_long max_get_array_index_length; | ||
| 86 | zend_bool disallow_get_nul; | ||
| 87 | zend_bool disallow_get_ws; | ||
| 88 | /* post variables */ | ||
| 89 | zend_long max_post_vars; | ||
| 90 | zend_long cur_post_vars; | ||
| 91 | zend_long att_post_vars; | ||
| 92 | zend_long max_post_name_length; | ||
| 93 | zend_long max_post_totalname_length; | ||
| 94 | zend_long max_post_value_length; | ||
| 95 | zend_long max_post_array_depth; | ||
| 96 | zend_long max_post_array_index_length; | ||
| 97 | zend_bool disallow_post_nul; | ||
| 98 | zend_bool disallow_post_ws; | ||
| 99 | |||
| 100 | /* fileupload */ | ||
| 101 | zend_long upload_limit; | ||
| 102 | zend_long upload_max_newlines; | ||
| 103 | zend_long num_uploads; | ||
| 104 | zend_bool upload_disallow_elf; | ||
| 105 | zend_bool upload_disallow_binary; | ||
| 106 | zend_bool upload_remove_binary; | ||
| 107 | #ifdef SUHOSIN_EXPERIMENTAL | ||
| 108 | zend_bool upload_allow_utf8; | ||
| 109 | #endif | ||
| 110 | char *upload_verification_script; | ||
| 111 | |||
| 112 | zend_bool no_more_variables; | ||
| 113 | zend_bool no_more_get_variables; | ||
| 114 | zend_bool no_more_post_variables; | ||
| 115 | zend_bool no_more_cookie_variables; | ||
| 116 | zend_bool no_more_uploads; | ||
| 117 | |||
| 118 | BYTE fi[24],ri[24]; | ||
| 119 | WORD fkey[120]; | ||
| 120 | WORD rkey[120]; | ||
| 121 | |||
| 122 | /* memory_limit */ | ||
| 123 | zend_long memory_limit; | ||
| 124 | zend_long hard_memory_limit; | ||
| 125 | |||
| 126 | char* decrypted_cookie; | ||
| 127 | char* raw_cookie; | ||
| 128 | zend_bool cookie_encrypt; | ||
| 129 | char* cookie_cryptkey; | ||
| 130 | zend_bool cookie_cryptua; | ||
| 131 | zend_bool cookie_cryptdocroot; | ||
| 132 | long cookie_cryptraddr; | ||
| 133 | long cookie_checkraddr; | ||
| 134 | HashTable *cookie_plainlist; | ||
| 135 | HashTable *cookie_cryptlist; | ||
| 136 | ZEND_END_MODULE_GLOBALS(suhosin7) | ||
| 137 | |||
| 138 | /* Always refer to the globals in your function as SUHOSIN7_G(variable). | ||
| 139 | You are encouraged to rename these macros something shorter, see | ||
| 140 | examples in any other php module directory. | ||
| 141 | */ | ||
| 142 | #define SUHOSIN7_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(suhosin7, v) | ||
| 143 | |||
| 144 | #if defined(ZTS) && defined(COMPILE_DL_SUHOSIN7) | ||
| 145 | ZEND_TSRMLS_CACHE_EXTERN(); | ||
| 146 | #endif | ||
| 147 | |||
| 148 | /* Error Constants */ | ||
| 149 | #ifndef S_MEMORY | ||
| 150 | #define S_MEMORY (1<<0L) | ||
| 151 | #define S_MISC (1<<1L) | ||
| 152 | #define S_VARS (1<<2L) | ||
| 153 | #define S_FILES (1<<3L) | ||
| 154 | #define S_INCLUDE (1<<4L) | ||
| 155 | #define S_SQL (1<<5L) | ||
| 156 | #define S_EXECUTOR (1<<6L) | ||
| 157 | #define S_MAIL (1<<7L) | ||
| 158 | #define S_SESSION (1<<8L) | ||
| 159 | #define S_INTERNAL (1<<29L) | ||
| 160 | #define S_ALL (S_MEMORY | S_VARS | S_INCLUDE | S_FILES | S_MAIL | S_SESSION | S_MISC | S_SQL | S_EXECUTOR) | ||
| 161 | #endif | ||
| 162 | |||
| 163 | #ifndef S_GETCALLER | ||
| 164 | #define S_GETCALLER (1<<30L) | ||
| 165 | #endif | ||
| 166 | |||
| 167 | #define SUHOSIN_NORMAL 0 | ||
| 168 | #define SUHOSIN_EVAL 1 | ||
| 169 | |||
| 170 | #define SUHOSIN_FLAG_CREATED_BY_EVAL 1 | ||
| 171 | #define SUHOSIN_FLAG_NOT_EVALED_CODE 2 | ||
| 172 | |||
| 173 | ZEND_EXTERN_MODULE_GLOBALS(suhosin7) | ||
| 174 | |||
| 175 | unsigned int suhosin_input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); | ||
| 176 | unsigned int suhosin_input_filter_wrapper(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); | ||
| 177 | void suhosin_log(int loglevel, char *fmt, ...); | ||
| 178 | extern unsigned int (*old_input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); | ||
| 179 | |||
| 180 | |||
| 181 | #endif /* PHP_SUHOSIN7_H */ | ||
| 182 | |||
| 183 | |||
| 184 | /* | ||
| 185 | * Local variables: | ||
| 186 | * tab-width: 4 | ||
| 187 | * c-basic-offset: 4 | ||
| 188 | * End: | ||
| 189 | * vim600: noet sw=4 ts=4 fdm=marker | ||
| 190 | * vim<600: noet sw=4 ts=4 | ||
| 191 | */ | ||
