From bed568094b95b65a43c44d7b4d38aced394fce1c Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 25 Sep 2017 14:04:21 +0200 Subject: Show the line number in case of processing error --- src/sp_config.c | 20 +++++++----- src/sp_config.h | 2 ++ src/sp_config_keywords.c | 44 +++++++++++++------------- src/sp_config_utils.c | 20 ++++++------ src/tests/broken_conf.phpt | 2 +- src/tests/broken_conf2.phpt | 2 +- src/tests/broken_conf_config_regexp.phpt | 4 +-- src/tests/broken_conf_enable_disable.phpt | 2 +- src/tests/broken_conf_expecting_bool.phpt | 2 +- src/tests/broken_conf_expecting_int.phpt | 2 +- src/tests/broken_conf_invalid_cidr_value.phpt | 4 +-- src/tests/broken_conf_invalid_type.phpt | 2 +- src/tests/broken_conf_line_empty_string.phpt | 2 +- src/tests/broken_conf_line_no_closing.phpt | 2 +- src/tests/broken_conf_line_too_long.phpt | 4 +-- src/tests/broken_conf_lots_of_quotes.phpt | 2 +- src/tests/broken_conf_mutually_exclusive.phpt | 2 +- src/tests/broken_conf_mutually_exclusive2.phpt | 2 +- src/tests/broken_conf_mutually_exclusive3.phpt | 2 +- src/tests/broken_conf_mutually_exclusive4.phpt | 2 +- src/tests/broken_conf_mutually_exclusive5.phpt | 2 +- src/tests/broken_conf_mutually_exclusive6.phpt | 2 +- src/tests/broken_conf_mutually_exclusive7.phpt | 2 +- src/tests/broken_conf_mutually_exclusive8.phpt | 2 +- src/tests/broken_conf_no_closing_misc.phpt | 4 +-- src/tests/broken_conf_weird_keyword.phpt | 2 +- src/tests/broken_conf_wrong_quotes.phpt | 2 +- src/tests/broken_conf_wrong_type.phpt | 2 +- src/tests/broken_regexp.phpt | 2 +- 29 files changed, 76 insertions(+), 68 deletions(-) (limited to 'src') diff --git a/src/sp_config.c b/src/sp_config.c index 37a34b9..3da027c 100644 --- a/src/sp_config.c +++ b/src/sp_config.c @@ -6,6 +6,8 @@ ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus) +size_t sp_line_no; + sp_config_tokens const sp_func[] = { {.func = parse_unserialize, .token = SP_TOKEN_UNSERIALIZE_HMAC}, {.func = parse_random, .token = SP_TOKEN_HARDEN_RANDOM}, @@ -33,7 +35,7 @@ static int parse_line(char *line) { } if (strncmp(ptr, SP_TOKEN_BASE, strlen(SP_TOKEN_BASE))) { - sp_log_err("config", "Invalid configuration prefix for '%s'.", line); + sp_log_err("config", "Invalid configuration prefix for '%s' on line %zu.", line, sp_line_no); return -1; } ptr += strlen(SP_TOKEN_BASE); @@ -43,7 +45,7 @@ static int parse_line(char *line) { return sp_func[i].func(ptr + strlen(sp_func[i].token)); } } - sp_log_err("config", "Invalid configuration section '%s'.", line); + sp_log_err("config", "Invalid configuration section '%s' on line %zu.", line, sp_line_no); return -1; } @@ -61,7 +63,7 @@ int parse_int(char *restrict line, char *restrict keyword, void *retval) { pefree(value, 1); return consumed; } else { - sp_log_err("error", "%s) is expecting a valid integer.", keyword); + sp_log_err("error", "%s) is expecting a valid integer on line %zu.", keyword, sp_line_no); return -1; } } @@ -96,7 +98,7 @@ int parse_php_type(char *restrict line, char *restrict keyword, void *retval) { pefree(value, 1); sp_log_err("error", "%s) is expecting a valid php type ('false', 'true'," " 'array'. 'object', 'long', 'double', 'null', 'resource', 'reference'," - " 'undef').", keyword); + " 'undef') on line %zu.", keyword, sp_line_no); return -1; } pefree(value, 1); @@ -130,7 +132,7 @@ int parse_cidr(char *restrict line, char *restrict keyword, void *retval) { *(sp_cidr **)retval = cidr; return consumed; } else { - sp_log_err("config", "%s doesn't contain a valid cidr.", line); + sp_log_err("config", "%s doesn't contain a valid cidr on line %zu.", line, sp_line_no); return -1; } } @@ -148,7 +150,7 @@ int parse_regexp(char *restrict line, char *restrict keyword, void *retval) { pcre *compiled_re = sp_pcre_compile(value, PCRE_CASELESS, &pcre_error, &pcre_error_offset, NULL); if (NULL == compiled_re) { - sp_log_err("config", "Failed to compile '%s': %s.", value, pcre_error); + sp_log_err("config", "Failed to compile '%s': %s on line %zu.", value, pcre_error, sp_line_no); } else { *(pcre **)retval = compiled_re; return consumed; @@ -158,8 +160,8 @@ int parse_regexp(char *restrict line, char *restrict keyword, void *retval) { if (NULL != closing_paren) { closing_paren[0] = '\0'; } - sp_log_err("config", "'%s)' is expecting a valid regexp, and not '%s'.", - keyword, line); + sp_log_err("config", "'%s)' is expecting a valid regexp, and not '%s' on line %zu.", + keyword, line, sp_line_no); return -1; } @@ -167,6 +169,7 @@ int sp_parse_config(const char *conf_file) { FILE *fd = fopen(conf_file, "r"); char *lineptr = NULL; size_t n = 0; + sp_line_no = 1; if (fd == NULL) { sp_log_err("config", "Could not open configuration file %s : %s", conf_file, @@ -187,6 +190,7 @@ int sp_parse_config(const char *conf_file) { free(lineptr); lineptr = NULL; n = 0; + sp_line_no++; } fclose(fd); return SUCCESS; diff --git a/src/sp_config.h b/src/sp_config.h index 54ec2cc..8d41333 100644 --- a/src/sp_config.h +++ b/src/sp_config.h @@ -5,6 +5,8 @@ #include #include +extern size_t sp_line_no; + typedef enum { SP_TYPE_STR = 0, SP_TYPE_REGEXP, diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index 4a6dd3a..b068bec 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c @@ -17,7 +17,7 @@ static int parse_enable(char *line, bool * restrict retval, bool * restrict simu } if (!(enable ^ disable)) { - sp_log_err("config", "A rule can't be enabled and disabled."); + sp_log_err("config", "A rule can't be enabled and disabled on line %zu.", sp_line_no); return -1; } @@ -135,50 +135,50 @@ int parse_disabled_functions(char *line) { if (df->value && df->regexp) { sp_log_err("config", "Invalid configuration line: 'sp.disabled_functions%s':" - "'.value' and '.regexp' are mutually exclusives.", - line); + "'.value' and '.regexp' are mutually exclusives on line %zu.", + line, sp_line_no); return -1; } else if (df->r_function && df->function) { sp_log_err("config", "Invalid configuration line: 'sp.disabled_functions%s': " - "'.r_function' and '.function' are mutually exclusive.", - line); + "'.r_function' and '.function' are mutually exclusive on line %zu.", + line, sp_line_no); return -1; } else if (df->r_filename && df->filename) { sp_log_err("config", "Invalid configuration line: 'sp.disabled_functions%s':" - "'.r_filename' and '.filename' are mutually exclusive.", - line); + "'.r_filename' and '.filename' are mutually exclusive on line %zu.", + line, sp_line_no); return -1; } else if (df->r_param && df->param) { sp_log_err("config", "Invalid configuration line: 'sp.disabled_functions%s':" - "'.r_param' and '.param' are mutually exclusive.", - line); + "'.r_param' and '.param' are mutually exclusive on line %zu.", + line, sp_line_no); return -1; } else if (df->r_ret && df->ret) { sp_log_err("config", "Invalid configuration line: 'sp.disabled_functions%s':" - "'.r_ret' and '.ret' are mutually exclusive.", - line); + "'.r_ret' and '.ret' are mutually exclusive on line %zu.", + line, sp_line_no); return -1; } else if ((df->r_ret || df->ret) && (df->r_param || df->param)) { sp_log_err("config", "Invalid configuration line: 'sp.disabled_functions%s':" - "`ret` and `param` are mutually exclusives.", - line); + "`ret` and `param` are mutually exclusive on line %zu.", + line, sp_line_no); return -1; } else if (!(df->r_function || df->function)) { sp_log_err("config", "Invalid configuration line: 'sp.disabled_functions%s':" - " must take a function name.", - line); + " must take a function name on line %zu.", + line, sp_line_no); return -1; } else if (!(df->allow ^ df->drop)) { sp_log_err("config", "Invalid configuration line: 'sp.disabled_functions%s': The " - "rule must either be a `drop` or and `allow` one.", - line); + "rule must either be a `drop` or and `allow` one on line %zu.", + line, sp_line_no); return -1; } @@ -245,7 +245,7 @@ int parse_upload_validation(char *line) { } if (!(enable ^ disable)) { - sp_log_err("config", "A rule can't be enabled and disabled."); + sp_log_err("config", "A rule can't be enabled and disabled on line %zu.", sp_line_no); return -1; } SNUFFLEUPAGUS_G(config).config_upload_validation->enable = enable; @@ -253,14 +253,14 @@ int parse_upload_validation(char *line) { char const *script = SNUFFLEUPAGUS_G(config).config_upload_validation->script; if (!script) { - sp_log_err("config", "The `script` directive is mandatory in %s", - line); + sp_log_err("config", "The `script` directive is mandatory in '%s' on line %zu.", + line, sp_line_no); return -1; } else if (-1 == access(script, F_OK)) { - sp_log_err("config", "The `script` (%s) doesn't exist.", script); + sp_log_err("config", "The `script` (%s) doesn't exist on line %zu.", script, sp_line_no); return -1; } else if (-1 == access(script, X_OK)) { - sp_log_err("config", "The `script` (%s) isn't executable.", script); + sp_log_err("config", "The `script` (%s) isn't executable on line %zu.", script, sp_line_no); return -1; } diff --git a/src/sp_config_utils.c b/src/sp_config_utils.c index e05e95e..39951cc 100644 --- a/src/sp_config_utils.c +++ b/src/sp_config_utils.c @@ -1,5 +1,7 @@ #include "php_snuffleupagus.h" +size_t sp_line_no; + static int validate_int(const char *value); static int validate_str(const char *value); @@ -55,8 +57,8 @@ int parse_keywords(sp_config_functions *funcs, char *line) { } if (*line) { - sp_log_err("config", "Trailing chars '%s' at the end of '%s'.", line, - original_line); + sp_log_err("config", "Trailing chars '%s' at the end of '%s' on line %zu.", + line, original_line, sp_line_no); return -1; } return 0; @@ -116,8 +118,8 @@ static char *get_string(size_t *consumed, char *restrict line, } err: sp_log_err("error", - "There is an issue with the parsing of '%s': it doesn't look like a valid string.", - original_line ? original_line : "NULL"); + "There is an issue with the parsing of '%s': it doesn't look like a valid string on line %zu.", + original_line ? original_line : "NULL", sp_line_no); line = NULL; return NULL; } @@ -133,15 +135,15 @@ static char *get_misc(char *restrict line, const char *restrict keyword) { if (line[i] != SP_TOKEN_END_PARAM) { if (i >= 1024 - 1) { - sp_log_err("config", "The following line is too long: %s.", line); + sp_log_err("config", "The following line is too long: %s on line %zu.", line, sp_line_no); } else { - sp_log_err("config", "Missing closing %c in line %s.", SP_TOKEN_END_PARAM, - line); + sp_log_err("config", "Missing closing %c in line %s on line %zu.", SP_TOKEN_END_PARAM, + line, sp_line_no); } return NULL; } else if (i == 0) { - sp_log_err("config", "The keyword %s%c is expecting a parameter.", - keyword, SP_TOKEN_END_PARAM); + sp_log_err("config", "The keyword %s%c is expecting a parameter on line %zu.", + keyword, SP_TOKEN_END_PARAM, sp_line_no); return NULL; } return ret; diff --git a/src/tests/broken_conf.phpt b/src/tests/broken_conf.phpt index ae0ef6e..9b461bb 100644 --- a/src/tests/broken_conf.phpt +++ b/src/tests/broken_conf.phpt @@ -6,5 +6,5 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration prefix for 'this is a broken line'. +[snuffleupagus][0.0.0.0][config][error] Invalid configuration prefix for 'this is a broken line' on line 1. diff --git a/src/tests/broken_conf2.phpt b/src/tests/broken_conf2.phpt index 88a2232..da9ac95 100644 --- a/src/tests/broken_conf2.phpt +++ b/src/tests/broken_conf2.phpt @@ -6,4 +6,4 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf2.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration section 'sp.wrong'. +[snuffleupagus][0.0.0.0][config][error] Invalid configuration section 'sp.wrong' on line 1. diff --git a/src/tests/broken_conf_config_regexp.phpt b/src/tests/broken_conf_config_regexp.phpt index 75bc603..d2a379e 100644 --- a/src/tests/broken_conf_config_regexp.phpt +++ b/src/tests/broken_conf_config_regexp.phpt @@ -6,5 +6,5 @@ Broken configuration sp.configuration_file={PWD}/config/broken_config_regexp.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Failed to compile '*.': nothing to repeat. -[snuffleupagus][0.0.0.0][config][error] '.filename_r()' is expecting a valid regexp, and not '"*."'. +[snuffleupagus][0.0.0.0][config][error] Failed to compile '*.': nothing to repeat on line 1. +[snuffleupagus][0.0.0.0][config][error] '.filename_r()' is expecting a valid regexp, and not '"*."' on line 1. diff --git a/src/tests/broken_conf_enable_disable.phpt b/src/tests/broken_conf_enable_disable.phpt index 2f3fe19..5d860b9 100644 --- a/src/tests/broken_conf_enable_disable.phpt +++ b/src/tests/broken_conf_enable_disable.phpt @@ -6,4 +6,4 @@ Global strict mode sp.configuration_file={PWD}/config/borken_conf_enable_disable.ini --FILE-- --EXPECTF-- -[snuffleupagus][0.0.0.0][config][error] A rule can't be enabled and disabled. +[snuffleupagus][0.0.0.0][config][error] A rule can't be enabled and disabled on line 1. diff --git a/src/tests/broken_conf_expecting_bool.phpt b/src/tests/broken_conf_expecting_bool.phpt index 80e1b61..a6aceb2 100644 --- a/src/tests/broken_conf_expecting_bool.phpt +++ b/src/tests/broken_conf_expecting_bool.phpt @@ -6,4 +6,4 @@ Bad boolean value in configuration sp.configuration_file={PWD}/config/broken_conf_expecting_bool.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Trailing chars '337);' at the end of '.enable(1337);'. +[snuffleupagus][0.0.0.0][config][error] Trailing chars '337);' at the end of '.enable(1337);' on line 5. diff --git a/src/tests/broken_conf_expecting_int.phpt b/src/tests/broken_conf_expecting_int.phpt index e806337..207e21a 100644 --- a/src/tests/broken_conf_expecting_int.phpt +++ b/src/tests/broken_conf_expecting_int.phpt @@ -6,4 +6,4 @@ Bad integer value in configuration sp.configuration_file={PWD}/config/broken_conf_expecting_int.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][error][error] .mask_ipv4() is expecting a valid integer. +[snuffleupagus][0.0.0.0][error][error] .mask_ipv4() is expecting a valid integer on line 2. diff --git a/src/tests/broken_conf_invalid_cidr_value.phpt b/src/tests/broken_conf_invalid_cidr_value.phpt index 712f123..876e9a0 100644 --- a/src/tests/broken_conf_invalid_cidr_value.phpt +++ b/src/tests/broken_conf_invalid_cidr_value.phpt @@ -7,5 +7,5 @@ Broken configuration, invalid cidr value sp.configuration_file={PWD}/config/broken_conf_invalid_cidr_value.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"': it doesn't look like a valid string. -[snuffleupagus][0.0.0.0][config][error] " doesn't contain a valid cidr. +[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"': it doesn't look like a valid string on line 1. +[snuffleupagus][0.0.0.0][config][error] " doesn't contain a valid cidr on line 1. diff --git a/src/tests/broken_conf_invalid_type.phpt b/src/tests/broken_conf_invalid_type.phpt index 29d2ff5..246492f 100644 --- a/src/tests/broken_conf_invalid_type.phpt +++ b/src/tests/broken_conf_invalid_type.phpt @@ -6,4 +6,4 @@ Broken conf with wrong type sp.configuration_file={PWD}/config/broken_conf_invalid_type.ini --FILE-- --EXPECTF-- -[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"totally_wrong"_type")': it doesn't look like a valid string. +[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"totally_wrong"_type")': it doesn't look like a valid string on line 1. diff --git a/src/tests/broken_conf_line_empty_string.phpt b/src/tests/broken_conf_line_empty_string.phpt index c4334b9..ba8f9ca 100644 --- a/src/tests/broken_conf_line_empty_string.phpt +++ b/src/tests/broken_conf_line_empty_string.phpt @@ -6,4 +6,4 @@ Configuration line with an empty string sp.configuration_file={PWD}/config/broken_conf_line_empty_string.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '': it doesn't look like a valid string. +[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '': it doesn't look like a valid string on line 1. diff --git a/src/tests/broken_conf_line_no_closing.phpt b/src/tests/broken_conf_line_no_closing.phpt index 07c94e4..13e3aa1 100644 --- a/src/tests/broken_conf_line_no_closing.phpt +++ b/src/tests/broken_conf_line_no_closing.phpt @@ -6,4 +6,4 @@ Configuration line without closing parenthese sp.configuration_file={PWD}/config/broken_conf_line_no_closing.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"123"': it doesn't look like a valid string. +[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"123"': it doesn't look like a valid string on line 1. diff --git a/src/tests/broken_conf_line_too_long.phpt b/src/tests/broken_conf_line_too_long.phpt index 8e82708..c4e3938 100644 --- a/src/tests/broken_conf_line_too_long.phpt +++ b/src/tests/broken_conf_line_too_long.phpt @@ -6,5 +6,5 @@ Line too long in configuration sp.configuration_file={PWD}/config/broken_conf_line_too_long.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] The following line is too long: 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111);. -[snuffleupagus][0.0.0.0][error][error] .mask_ipv4() is expecting a valid integer. +[snuffleupagus][0.0.0.0][config][error] The following line is too long: 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111); on line 1. +[snuffleupagus][0.0.0.0][error][error] .mask_ipv4() is expecting a valid integer on line 1. diff --git a/src/tests/broken_conf_lots_of_quotes.phpt b/src/tests/broken_conf_lots_of_quotes.phpt index e877cfa..bad4a35 100644 --- a/src/tests/broken_conf_lots_of_quotes.phpt +++ b/src/tests/broken_conf_lots_of_quotes.phpt @@ -6,4 +6,4 @@ Configuration line with too many quotes sp.configuration_file={PWD}/config/broken_conf_lots_of_quotes.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"this\"is a weird\"\"\"cookie\"name"");': it doesn't look like a valid string. +[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"this\"is a weird\"\"\"cookie\"name"");': it doesn't look like a valid string on line 1. diff --git a/src/tests/broken_conf_mutually_exclusive.phpt b/src/tests/broken_conf_mutually_exclusive.phpt index 9de7e5a..7bfd313 100644 --- a/src/tests/broken_conf_mutually_exclusive.phpt +++ b/src/tests/broken_conf_mutually_exclusive.phpt @@ -6,4 +6,4 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").value_r("^id$").drop();':'.value' and '.regexp' are mutually exclusives. \ No newline at end of file +[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").value_r("^id$").drop();':'.value' and '.regexp' are mutually exclusives on line 1. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive2.phpt b/src/tests/broken_conf_mutually_exclusive2.phpt index 9d3ea36..cfbf13a 100644 --- a/src/tests/broken_conf_mutually_exclusive2.phpt +++ b/src/tests/broken_conf_mutually_exclusive2.phpt @@ -6,4 +6,4 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive2.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").function_r("system").param("id").value("42").drop();': '.r_function' and '.function' are mutually exclusive. \ No newline at end of file +[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").function_r("system").param("id").value("42").drop();': '.r_function' and '.function' are mutually exclusive on line 1. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive3.phpt b/src/tests/broken_conf_mutually_exclusive3.phpt index 58686a3..3be561c 100644 --- a/src/tests/broken_conf_mutually_exclusive3.phpt +++ b/src/tests/broken_conf_mutually_exclusive3.phpt @@ -6,4 +6,4 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive3.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").filename_r("^id$").filename("pouet.txt").drop();':'.r_filename' and '.filename' are mutually exclusive. \ No newline at end of file +[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").filename_r("^id$").filename("pouet.txt").drop();':'.r_filename' and '.filename' are mutually exclusive on line 1. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive4.phpt b/src/tests/broken_conf_mutually_exclusive4.phpt index d854380..4e888f5 100644 --- a/src/tests/broken_conf_mutually_exclusive4.phpt +++ b/src/tests/broken_conf_mutually_exclusive4.phpt @@ -6,4 +6,4 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive4.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").param_r("^id$").drop();':'.r_param' and '.param' are mutually exclusive. \ No newline at end of file +[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").param_r("^id$").drop();':'.r_param' and '.param' are mutually exclusive on line 1. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive5.phpt b/src/tests/broken_conf_mutually_exclusive5.phpt index a265c30..9ebc930 100644 --- a/src/tests/broken_conf_mutually_exclusive5.phpt +++ b/src/tests/broken_conf_mutually_exclusive5.phpt @@ -6,4 +6,4 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive5.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").ret("0").drop().ret_r("^0$");':'.r_ret' and '.ret' are mutually exclusive. \ No newline at end of file +[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").ret("0").drop().ret_r("^0$");':'.r_ret' and '.ret' are mutually exclusive on line 1. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive6.phpt b/src/tests/broken_conf_mutually_exclusive6.phpt index d0cdb85..4c8cf72 100644 --- a/src/tests/broken_conf_mutually_exclusive6.phpt +++ b/src/tests/broken_conf_mutually_exclusive6.phpt @@ -6,4 +6,4 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive6.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").ret_r("^0$").drop();':`ret` and `param` are mutually exclusives. \ No newline at end of file +[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").ret_r("^0$").drop();':`ret` and `param` are mutually exclusive on line 1. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive7.phpt b/src/tests/broken_conf_mutually_exclusive7.phpt index c9a3513..419cfd4 100644 --- a/src/tests/broken_conf_mutually_exclusive7.phpt +++ b/src/tests/broken_conf_mutually_exclusive7.phpt @@ -6,4 +6,4 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive7.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").ret("0").drop().allow();': The rule must either be a `drop` or and `allow` one. \ No newline at end of file +[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").ret("0").drop().allow();': The rule must either be a `drop` or and `allow` one on line 1. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive8.phpt b/src/tests/broken_conf_mutually_exclusive8.phpt index 7c5baee..f7bf341 100644 --- a/src/tests/broken_conf_mutually_exclusive8.phpt +++ b/src/tests/broken_conf_mutually_exclusive8.phpt @@ -6,4 +6,4 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive8.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.ret("0").drop();': must take a function name. \ No newline at end of file +[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.ret("0").drop();': must take a function name on line 1. \ No newline at end of file diff --git a/src/tests/broken_conf_no_closing_misc.phpt b/src/tests/broken_conf_no_closing_misc.phpt index 1d1e112..933f290 100644 --- a/src/tests/broken_conf_no_closing_misc.phpt +++ b/src/tests/broken_conf_no_closing_misc.phpt @@ -6,5 +6,5 @@ Configuration line without closing parenthese, misc sp.configuration_file={PWD}/config/broken_conf_no_closing_misc.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Missing closing ) in line 123. -[snuffleupagus][0.0.0.0][error][error] .mask_ipv4() is expecting a valid integer. +[snuffleupagus][0.0.0.0][config][error] Missing closing ) in line 123 on line 1. +[snuffleupagus][0.0.0.0][error][error] .mask_ipv4() is expecting a valid integer on line 1. diff --git a/src/tests/broken_conf_weird_keyword.phpt b/src/tests/broken_conf_weird_keyword.phpt index 5293791..17de7fe 100644 --- a/src/tests/broken_conf_weird_keyword.phpt +++ b/src/tests/broken_conf_weird_keyword.phpt @@ -6,4 +6,4 @@ Bad config, unknown keyword sp.configuration_file={PWD}/config/broken_conf_weird_keyword.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][config][error] Trailing chars '.not_a_valid_keyword("test");' at the end of '.enable().not_a_valid_keyword("test");'. \ No newline at end of file +[snuffleupagus][0.0.0.0][config][error] Trailing chars '.not_a_valid_keyword("test");' at the end of '.enable().not_a_valid_keyword("test");' on line 1. \ No newline at end of file diff --git a/src/tests/broken_conf_wrong_quotes.phpt b/src/tests/broken_conf_wrong_quotes.phpt index b6324fe..00aaefb 100644 --- a/src/tests/broken_conf_wrong_quotes.phpt +++ b/src/tests/broken_conf_wrong_quotes.phpt @@ -6,4 +6,4 @@ Configuration line with too many quotes sp.configuration_file={PWD}/config/broken_conf_wrong_quotes.ini --FILE-- --EXPECT-- -[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"\)': it doesn't look like a valid string. +[snuffleupagus][0.0.0.0][error][error] There is an issue with the parsing of '"\)': it doesn't look like a valid string on line 1. diff --git a/src/tests/broken_conf_wrong_type.phpt b/src/tests/broken_conf_wrong_type.phpt index 338ca3a..765c576 100644 --- a/src/tests/broken_conf_wrong_type.phpt +++ b/src/tests/broken_conf_wrong_type.phpt @@ -6,4 +6,4 @@ Broken conf with wrong type sp.configuration_file={PWD}/config/broken_conf_wrong_type.ini --FILE-- --EXPECTF-- -[snuffleupagus][0.0.0.0][error][error] .ret_type() is expecting a valid php type ('false', 'true', 'array'. 'object', 'long', 'double', 'null', 'resource', 'reference', 'undef'). +[snuffleupagus][0.0.0.0][error][error] .ret_type() is expecting a valid php type ('false', 'true', 'array'. 'object', 'long', 'double', 'null', 'resource', 'reference', 'undef') on line 5. diff --git a/src/tests/broken_regexp.phpt b/src/tests/broken_regexp.phpt index cbfef7d..3367997 100644 --- a/src/tests/broken_regexp.phpt +++ b/src/tests/broken_regexp.phpt @@ -6,4 +6,4 @@ Broken regexp sp.configuration_file={PWD}/config/broken_regexp.ini --FILE-- --EXPECTF-- -[snuffleupagus][0.0.0.0][config][error] '.value_r()' is expecting a valid regexp, and not '"^$["'. +[snuffleupagus][0.0.0.0][config][error] '.value_r()' is expecting a valid regexp, and not '"^$["' on line 1. -- cgit v1.3