]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mailers: Set the object type for check attached to an email alert
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Jun 2022 07:17:14 +0000 (09:17 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Jun 2022 13:28:38 +0000 (15:28 +0200)
The health-check attached to an email alert has no type. It is unexpected,
and since the 2.6, it is important because we rely on it to know the
application type in front of a connection at the stream-connector
level. Because the object type is not set, the SE descriptor is not properly
initialized, leading to a segfault when a connection to the SMTP server is
established.

This patch must be backported to 2.6 and may be backported as far as
2.0. However, it is only an issue for the 2.6 and upper.

src/mailers.c

index 34eaa5bb640191df16a9758a055c93ac1a604ec4..05d531306fa4d559a8889363851558a16063e8e5 100644 (file)
@@ -120,6 +120,7 @@ int init_email_alert(struct mailers *mls, struct proxy *p, char **err)
 
                LIST_INIT(&q->email_alerts);
                HA_SPIN_INIT(&q->lock);
+               check->obj_type = OBJ_TYPE_CHECK;
                check->inter = mls->timeout.mail;
                check->rise = DEF_AGENT_RISETIME;
                check->proxy = p;