diff options
Diffstat (limited to 'src/sp_config.h')
| -rw-r--r-- | src/sp_config.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/sp_config.h b/src/sp_config.h index f3b64a6..bd2530a 100644 --- a/src/sp_config.h +++ b/src/sp_config.h | |||
| @@ -30,6 +30,8 @@ typedef enum { | |||
| 30 | 30 | ||
| 31 | typedef enum { SP_ZEND = 0, SP_SYSLOG = 1 } sp_log_media; | 31 | typedef enum { SP_ZEND = 0, SP_SYSLOG = 1 } sp_log_media; |
| 32 | 32 | ||
| 33 | typedef enum { SP_UNSET = 0, SP_READONLY = 1, SP_READWRITE = -1 } sp_ini_permission; | ||
| 34 | |||
| 33 | typedef struct { | 35 | typedef struct { |
| 34 | int ip_version; | 36 | int ip_version; |
| 35 | union { | 37 | union { |
| @@ -163,6 +165,26 @@ typedef struct { | |||
| 163 | } sp_config_upload_validation; | 165 | } sp_config_upload_validation; |
| 164 | 166 | ||
| 165 | typedef struct { | 167 | typedef struct { |
| 168 | zend_string *key; | ||
| 169 | sp_ini_permission access; | ||
| 170 | zend_string *min; | ||
| 171 | zend_string *max; | ||
| 172 | sp_pcre *regexp; | ||
| 173 | bool simulation; | ||
| 174 | zend_string *msg; | ||
| 175 | zend_string *set; | ||
| 176 | PHP_INI_MH((*orig_onmodify)); | ||
| 177 | } sp_ini_entry; | ||
| 178 | |||
| 179 | typedef struct { | ||
| 180 | bool enable; | ||
| 181 | bool simulation; | ||
| 182 | // sp_ini_permission access_policy; | ||
| 183 | bool policy_readonly; | ||
| 184 | HashTable *entries; // ht of sp_ini_entry | ||
| 185 | } sp_config_ini; | ||
| 186 | |||
| 187 | typedef struct { | ||
| 166 | sp_config_random *config_random; | 188 | sp_config_random *config_random; |
| 167 | sp_config_sloppy *config_sloppy; | 189 | sp_config_sloppy *config_sloppy; |
| 168 | sp_config_unserialize *config_unserialize; | 190 | sp_config_unserialize *config_unserialize; |
| @@ -176,6 +198,7 @@ typedef struct { | |||
| 176 | sp_config_eval *config_eval; | 198 | sp_config_eval *config_eval; |
| 177 | sp_config_wrapper *config_wrapper; | 199 | sp_config_wrapper *config_wrapper; |
| 178 | sp_config_session *config_session; | 200 | sp_config_session *config_session; |
| 201 | sp_config_ini *config_ini; | ||
| 179 | bool hook_execute; | 202 | bool hook_execute; |
| 180 | char log_media; | 203 | char log_media; |
| 181 | 204 | ||
| @@ -215,6 +238,7 @@ typedef struct { | |||
| 215 | #define SP_TOKEN_EVAL_WHITELIST ".eval_whitelist" | 238 | #define SP_TOKEN_EVAL_WHITELIST ".eval_whitelist" |
| 216 | #define SP_TOKEN_SLOPPY_COMPARISON ".sloppy_comparison" | 239 | #define SP_TOKEN_SLOPPY_COMPARISON ".sloppy_comparison" |
| 217 | #define SP_TOKEN_ALLOW_WRAPPERS ".wrappers_whitelist" | 240 | #define SP_TOKEN_ALLOW_WRAPPERS ".wrappers_whitelist" |
| 241 | #define SP_TOKEN_INI ".ini" | ||
| 218 | 242 | ||
| 219 | // common tokens | 243 | // common tokens |
| 220 | #define SP_TOKEN_ENABLE ".enable(" | 244 | #define SP_TOKEN_ENABLE ".enable(" |
| @@ -284,6 +308,6 @@ int parse_list(char *restrict, char *restrict, void *); | |||
| 284 | void sp_free_disabled_function(void *data); | 308 | void sp_free_disabled_function(void *data); |
| 285 | void sp_free_cookie(void *data); | 309 | void sp_free_cookie(void *data); |
| 286 | void sp_free_zstr(void *data); | 310 | void sp_free_zstr(void *data); |
| 287 | 311 | void sp_free_ini_entry(void *data); | |
| 288 | 312 | ||
| 289 | #endif /* SP_CONFIG_H */ | 313 | #endif /* SP_CONFIG_H */ |
