mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-07 07:42:49 -04:00
MINOR: log-format: check number of arguments in cfgparse.c
Exit with error if there is a second argument in the 'log-format' and 'unique-id-format' options. It is convenient when we forgot to escape spaces.
This commit is contained in:
parent
316a8cfbc9
commit
3203ff4617
1 changed files with 10 additions and 0 deletions
|
|
@ -4702,6 +4702,11 @@ stats_error_parsing:
|
|||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
if (*(args[2])) {
|
||||
Alert("parsing [%s:%d] : %s expects only one argument, don't forget to escape spaces!\n", file, linenum, args[0]);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
free(curproxy->uniqueid_format_string);
|
||||
curproxy->uniqueid_format_string = strdup(args[1]);
|
||||
}
|
||||
|
|
@ -4722,6 +4727,11 @@ stats_error_parsing:
|
|||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
if (*(args[2])) {
|
||||
Alert("parsing [%s:%d] : %s expects only one argument, don't forget to escape spaces!\n", file, linenum, args[0]);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (curproxy->logformat_string != default_http_log_format &&
|
||||
curproxy->logformat_string != default_tcp_log_format &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue