mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
BUG/MINOR: ext-check: cannot use without preserve-env
Since1de44da("MINOR: ext-check: add an option to preserve environment variables"), it is now possible to provide an extra argument to "external-check" directive. This allows to support the "preserve-env" option which differs from the default behavior. However a mistake was made, because the config parser doesn't allow the default configuration anymore: using external-check without argument will trigger an error: 'external-check' only supports 'preserve-env' as an argument, found ''. This is due to as small mistake in the code that make the check systematically report an error if the first argument is not equal to "preserve-env". The check was modified so that the error is only reported if the argument is provided, so that the default behavior is restored. This should fix GH #2380 and should be backported on 2.9 and potentially further (anywhere1de44dais, because a note about an optional backport up to the 2.6 was left in the original commit message)
This commit is contained in:
parent
d7964c52ce
commit
63282f3bfb
1 changed files with 1 additions and 1 deletions
|
|
@ -591,7 +591,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
|
|||
global.external_check = 1;
|
||||
if (strcmp(args[1], "preserve-env") == 0) {
|
||||
global.external_check = 2;
|
||||
} else {
|
||||
} else if (*args[1]) {
|
||||
ha_alert("parsing [%s:%d] : '%s' only supports 'preserve-env' as an argument, found '%s'.\n", file, linenum, args[0], args[1]);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Reference in a new issue