From ee4f2e4a30f119b9348c02ac76185a54f5208e81 Mon Sep 17 00:00:00 2001 From: xXx-caillou-xXx Date: Tue, 31 Oct 2017 18:07:02 +0100 Subject: Unify two struct members related to virtual-patching This should close #65 --- src/sp_config_keywords.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/sp_config_keywords.c') diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index 569542c..416aaef 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c @@ -143,7 +143,7 @@ int parse_cookie_encryption(char *line) { int parse_disabled_functions(char *line) { int ret = 0; - bool enable = true, disable = false; + bool enable = true, disable = false, allow = false, drop = false; char *pos = NULL; char *line_number = NULL; sp_disabled_function *df = pecalloc(sizeof(*df), 1, 1); @@ -159,8 +159,8 @@ int parse_disabled_functions(char *line) { {parse_str, SP_TOKEN_FUNCTION, &(df->function)}, {parse_regexp, SP_TOKEN_FUNCTION_REGEXP, &(df->r_function)}, {parse_str, SP_TOKEN_DUMP, &(df->dump)}, - {parse_empty, SP_TOKEN_ALLOW, &(df->allow)}, - {parse_empty, SP_TOKEN_DROP, &(df->drop)}, + {parse_empty, SP_TOKEN_ALLOW, &(allow)}, + {parse_empty, SP_TOKEN_DROP, &(drop)}, {parse_str, SP_TOKEN_HASH, &(df->hash)}, {parse_str, SP_TOKEN_PARAM, &(df->param)}, {parse_regexp, SP_TOKEN_VALUE_REGEXP, &(df->value_r)}, @@ -224,10 +224,10 @@ int parse_disabled_functions(char *line) { " must take a function name on line %zu.", line, sp_line_no); return -1; - } else if (!(df->allow ^ df->drop)) { + } else if (!(allow ^ drop)) { sp_log_err("config", "Invalid configuration line: 'sp.disabled_functions%s': The " - "rule must either be a `drop` or and `allow` one on line %zu.", + "rule must either be a `drop` or `allow` one on line %zu.", line, sp_line_no); return -1; } @@ -254,6 +254,8 @@ int parse_disabled_functions(char *line) { } } + df->allow = allow; + if (df->function) { df->functions_list = parse_functions_list(df->function); } -- cgit v1.3