diff options
| author | jvoisin | 2018-01-04 15:59:59 +0100 |
|---|---|---|
| committer | GitHub | 2018-01-04 15:59:59 +0100 |
| commit | 3b113be573cdbca20ce9ec9c0a6efb25ccf51db5 (patch) | |
| tree | 5fabbd1da7cd740f26354ffbd2234eba71ffdead /src/sp_config_keywords.c | |
| parent | 84e423300c440e96c34ada2620e0f78f827592e8 (diff) | |
Eval blacklist
Add support for eval filtering, only blacklist for now
Diffstat (limited to 'src/sp_config_keywords.c')
| -rw-r--r-- | src/sp_config_keywords.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index 998b692..85e04ab 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -102,6 +102,25 @@ int parse_global(char *line) { | |||
| 102 | return parse_keywords(sp_config_funcs_global, line); | 102 | return parse_keywords(sp_config_funcs_global, line); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | int parse_eval_filter(char *line) { | ||
| 106 | char *token; | ||
| 107 | char *rest; | ||
| 108 | sp_config_functions sp_config_funcs[] = { | ||
| 109 | {parse_str, SP_TOKEN_EVAL_BLACKLIST, &rest}, | ||
| 110 | {parse_empty, SP_TOKEN_SIMULATION, | ||
| 111 | &(SNUFFLEUPAGUS_G(config).config_eval->simulation)}, | ||
| 112 | {0}}; | ||
| 113 | int ret = parse_keywords(sp_config_funcs, line); | ||
| 114 | if (0 != ret) { | ||
| 115 | return ret; | ||
| 116 | } | ||
| 117 | |||
| 118 | while ((token = strtok_r(rest, ",", &rest))) { | ||
| 119 | sp_list_insert(SNUFFLEUPAGUS_G(config).config_eval->blacklist, token); | ||
| 120 | } | ||
| 121 | return SUCCESS; | ||
| 122 | } | ||
| 123 | |||
| 105 | int parse_cookie(char *line) { | 124 | int parse_cookie(char *line) { |
| 106 | int ret = 0; | 125 | int ret = 0; |
| 107 | char *samesite = NULL; | 126 | char *samesite = NULL; |
