summaryrefslogtreecommitdiff
path: root/php_suhosin7.h
diff options
context:
space:
mode:
Diffstat (limited to 'php_suhosin7.h')
-rw-r--r--php_suhosin7.h35
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
366unsigned int suhosin_input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); 371unsigned int suhosin_input_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len);
367unsigned int suhosin_input_filter_wrapper(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); 372unsigned int suhosin_input_filter_wrapper(int arg, char *var, char **val, size_t val_len, size_t *new_val_len);
368void suhosin_log(int loglevel, char *fmt, ...); 373PHP_SUHOSIN7_API void suhosin_log(int loglevel, char *fmt, ...);
369extern unsigned int (*old_input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len); 374extern unsigned int (*old_input_filter)(int arg, char *var, char **val, size_t val_len, size_t *new_val_len);
370char *suhosin_getenv(char *name, size_t name_len); 375char *suhosin_getenv(char *name, size_t name_len);
371 376
377void suhosin_hook_memory_limit();
378void suhosin_hook_treat_data();
379void suhosin_hook_execute();
380void suhosin_hook_register_server_variables();
381
382static 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