From: Ben Cabot Date: Wed, 16 Sep 2015 11:07:51 +0000 (+0100) Subject: BUG: config: external-check command validation is checking for incorrect arguments. X-Git-Tag: v1.6-dev7~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=49795eb00c78518913587bb9a4439dc313036639;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index bc7cd9468a..610e165bab 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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++; }