mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 12:41:00 +02:00
BUG: config: external-check command validation is checking for incorrect arguments.
When using the external-check command option HAProxy was failing to start with a fatal error "'external-check' cannot handle unexpected argument". When looking at the code it was looking for an incorrect argument. Also correcting an Alert message text as spotted by by PiBa-NL.
This commit is contained in:
parent
61fdf8baa4
commit
49795eb00c
@ -3413,9 +3413,9 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
||||
}
|
||||
|
||||
if (!strcmp(args[1], "command")) {
|
||||
if (alertif_too_many_args(1, file, linenum, args, &err_code))
|
||||
if (alertif_too_many_args(2, file, linenum, args, &err_code))
|
||||
goto out;
|
||||
if (*(args[1]) == 0) {
|
||||
if (*(args[2]) == 0) {
|
||||
Alert("parsing [%s:%d] : missing argument after '%s'.\n",
|
||||
file, linenum, args[1]);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
@ -3425,9 +3425,9 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
||||
curproxy->check_command = strdup(args[2]);
|
||||
}
|
||||
else if (!strcmp(args[1], "path")) {
|
||||
if (alertif_too_many_args(1, file, linenum, args, &err_code))
|
||||
if (alertif_too_many_args(2, file, linenum, args, &err_code))
|
||||
goto out;
|
||||
if (*(args[1]) == 0) {
|
||||
if (*(args[2]) == 0) {
|
||||
Alert("parsing [%s:%d] : missing argument after '%s'.\n",
|
||||
file, linenum, args[1]);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
@ -7472,7 +7472,7 @@ int check_config_validity()
|
||||
clear = 1;
|
||||
}
|
||||
if (curproxy->check_command[0] != '/' && !curproxy->check_path) {
|
||||
Alert("Proxy '%s': '%s' does not have a leading '/' and 'external-command path' is not set.\n",
|
||||
Alert("Proxy '%s': '%s' does not have a leading '/' and 'external-check path' is not set.\n",
|
||||
curproxy->id, "external-check command");
|
||||
cfgerr++;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user