diff options
Diffstat (limited to 'php_suhosin7.h')
| -rw-r--r-- | php_suhosin7.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/php_suhosin7.h b/php_suhosin7.h index 9867759..8c10df9 100644 --- a/php_suhosin7.h +++ b/php_suhosin7.h | |||
| @@ -51,8 +51,10 @@ extern zend_module_entry suhosin7_module_entry; | |||
| 51 | #else | 51 | #else |
| 52 | 52 | ||
| 53 | #ifdef SUHOSIN7_DEBUG | 53 | #ifdef SUHOSIN7_DEBUG |
| 54 | // #define SDEBUG(msg...) \ | ||
| 55 | // {FILE *f;f=fopen(SUHOSIN_LOG, "a+");if(f){fprintf(f,"[%u] ",getpid());fprintf(f, msg);fprintf(f,"\n");fclose(f);}} | ||
| 54 | #define SDEBUG(msg...) \ | 56 | #define SDEBUG(msg...) \ |
| 55 | {FILE *f;f=fopen(SUHOSIN_LOG, "a+");if(f){fprintf(f,"[%u] ",getpid());fprintf(f, msg);fprintf(f,"\n");fclose(f);}} | 57 | {FILE *f;f=fopen(SUHOSIN_LOG, "a+");if(f){fprintf(f,"[%u] %s:%u %s #> ",getpid(), __FILE__, __LINE__, __func__);fprintf(f, msg);fprintf(f,"\n");fclose(f);}} |
| 56 | #else | 58 | #else |
| 57 | #define SDEBUG(msg...) | 59 | #define SDEBUG(msg...) |
| 58 | #endif | 60 | #endif |
| @@ -131,13 +133,16 @@ ZEND_BEGIN_MODULE_GLOBALS(suhosin7) | |||
| 131 | // zend_bool stealth; | 133 | // zend_bool stealth; |
| 132 | zend_bool already_scanned; | 134 | zend_bool already_scanned; |
| 133 | zend_bool abort_request; | 135 | zend_bool abort_request; |
| 134 | // char *filter_action; | ||
| 135 | // | ||
| 136 | // | 136 | // |
| 137 | |||
| 138 | /* executor */ | ||
| 139 | zend_ulong in_code_type; | ||
| 137 | // zend_bool executor_allow_symlink; | 140 | // zend_bool executor_allow_symlink; |
| 138 | // long max_execution_depth; | 141 | long execution_depth; |
| 139 | // long executor_include_max_traversal; | 142 | long max_execution_depth; |
| 140 | // zend_bool executor_include_allow_writable_files; | 143 | long executor_include_max_traversal; |
| 144 | zend_bool executor_include_allow_writable_files; | ||
| 145 | // char *filter_action; | ||
| 141 | 146 | ||
| 142 | 147 | ||
| 143 | HashTable *include_whitelist; | 148 | HashTable *include_whitelist; |
| @@ -148,8 +153,8 @@ ZEND_BEGIN_MODULE_GLOBALS(suhosin7) | |||
| 148 | HashTable *eval_whitelist; | 153 | HashTable *eval_whitelist; |
| 149 | HashTable *eval_blacklist; | 154 | HashTable *eval_blacklist; |
| 150 | 155 | ||
| 151 | // zend_bool executor_disable_eval; | 156 | zend_bool executor_disable_eval; |
| 152 | // zend_bool executor_disable_emod; | 157 | zend_bool executor_disable_emod; |
| 153 | 158 | ||
| 154 | 159 | ||
| 155 | /* request variables */ | 160 | /* request variables */ |
| @@ -365,10 +370,22 @@ ZEND_EXTERN_MODULE_GLOBALS(suhosin7) | |||
| 365 | 370 | ||
| 366 | unsigned int suhosin_input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); | 371 | unsigned int suhosin_input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); |
| 367 | unsigned int suhosin_input_filter_wrapper(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); | 372 | unsigned int suhosin_input_filter_wrapper(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); |
| 368 | void suhosin_log(int loglevel, char *fmt, ...); | 373 | PHP_SUHOSIN7_API void suhosin_log(int loglevel, char *fmt, ...); |
| 369 | extern unsigned int (*old_input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); | 374 | extern unsigned int (*old_input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); |
| 370 | char *suhosin_getenv(char *name, size_t name_len); | 375 | char *suhosin_getenv(char *name, size_t name_len); |
| 371 | 376 | ||
| 377 | void suhosin_hook_memory_limit(); | ||
| 378 | void suhosin_hook_treat_data(); | ||
| 379 | void suhosin_hook_execute(); | ||
| 380 | void suhosin_hook_register_server_variables(); | ||
| 381 | |||
| 382 | static inline void suhosin_bailout(TSRMLS_D) | ||
| 383 | { | ||
| 384 | if (!SUHOSIN7_G(simulation)) { | ||
| 385 | zend_bailout(); | ||
| 386 | } | ||
| 387 | } | ||
| 388 | |||
| 372 | 389 | ||
| 373 | #endif /* PHP_SUHOSIN7_H */ | 390 | #endif /* PHP_SUHOSIN7_H */ |
| 374 | 391 | ||
