]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: init: exit() after pre-check upon error
authorWilliam Lallemand <wlallemand@haproxy.org>
Wed, 4 May 2022 12:29:46 +0000 (14:29 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 4 May 2022 12:29:46 +0000 (14:29 +0200)
Add a test on the err_code variable so we don't go further if one of the
pre-check callback failed.

src/haproxy.c

index 02690edb7b7a74a508faf42f80ee04a90cb9a5c5..ec40a6427891251fb95cebbb1d4d2b575e65a12c 100644 (file)
@@ -2117,6 +2117,11 @@ static void init(int argc, char **argv)
        list_for_each_entry(prcf, &pre_check_list, list)
                err_code |= prcf->fct();
 
+       if (err_code & (ERR_ABORT|ERR_FATAL)) {
+               ha_alert("Fatal errors found in configuration.\n");
+               exit(1);
+       }
+
        err_code |= check_config_validity();
        for (px = proxies_list; px; px = px->next) {
                struct server *srv;