From: Christopher Faulet Date: Tue, 25 Oct 2022 14:45:38 +0000 (+0200) Subject: BUG/MAJOR: stick-table: don't process store-response rules for applets X-Git-Tag: v2.7-dev9~131 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b976640fe178c7084f0db4d443874ebe4746dca8;p=thirdparty%2Fhaproxy.git BUG/MAJOR: stick-table: don't process store-response rules for applets The commit bc7c207f74 ("BUG/MAJOR: stick-tables: do not try to index a server name for applets") tried to catch applets case when we tried to index the server name. However, there is still an issue. The applets are unconditionally casted to servers and this bug exists since a while. it's just luck if it doesn't crash. Now, when store rules are processed, we skip the rule if the stream's target is not a server or, of course, if it is a server but the "non-stick" option is set. However, we still take care to release the sticky session. This patch must be backported to all stable versions. --- diff --git a/src/stream.c b/src/stream.c index b19519f84a..f45f535110 100644 --- a/src/stream.c +++ b/src/stream.c @@ -1411,7 +1411,7 @@ static int process_store_rules(struct stream *s, struct channel *rep, int an_bit struct dict_entry *de; struct stktable *t = s->store[i].table; - if (objt_server(s->target) && __objt_server(s->target)->flags & SRV_F_NON_STICK) { + if (!objt_server(s->target) || (__objt_server(s->target)->flags & SRV_F_NON_STICK)) { stksess_free(s->store[i].table, s->store[i].ts); s->store[i].ts = NULL; continue;