]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: checks: email-alert not working when declared in defaults
authorCyril Bonté <cyril.bonte@free.fr>
Fri, 4 Dec 2015 02:07:06 +0000 (03:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 Dec 2015 05:09:30 +0000 (06:09 +0100)
Tommy Atkinson and Sylvain Faivre reported that email alerts didn't work when
they were declared in the defaults section. This is due to the use of an
internal attribute which is set once an email-alert is at least partially
configured. But this attribute was not propagated to the current proxy during
the configuration parsing.

Not that the issue doesn't occur if "email-alert myhostname" is configured in
the defaults section.

This fix must be backported to 1.6.

src/cfgparse.c

index 44070a541e9c543af83beb15c9bff63280009cc2..9ebae2cfad53963f607d3d7d77dc4ea04f431605 100644 (file)
@@ -2804,6 +2804,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                if (defproxy.email_alert.myhostname)
                        curproxy->email_alert.myhostname = strdup(defproxy.email_alert.myhostname);
                curproxy->email_alert.level = defproxy.email_alert.level;
+               curproxy->email_alert.set = defproxy.email_alert.set;
 
                goto out;
        }