66b5f1aec9994e452c074fc3415e41e0ae6233db
[openwrt-packages.git] /
1 commit 9eae8935663bc0b27c23018e8cc24ae9a3e31732
2 Author: Frédéric Lécaille <flecaille@haproxy.com>
3 Date:   Thu Jun 20 09:31:04 2019 +0200
4
5     BUG/MAJOR: sample: Wrong stick-table name parsing in "if/unless" ACL condition.
6     
7     This bug was introduced by 1b8e68e commit which supposed the stick-table was always
8     stored in struct arg at parsing time. This is never the case with the usage of
9     "if/unless" conditions in stick-table declared as backends. In this case, this is
10     the name of the proxy which must be considered as the stick-table name.
11     
12     This must be backported to 2.0.
13     
14     (cherry picked from commit 9417f4534ad742eda35c4cc3d1ccb390f75ea4b1)
15     Signed-off-by: Willy Tarreau <w@1wt.eu>
16
17 diff --git a/src/sample.c b/src/sample.c
18 index 67f59e84..77ec9b1e 100644
19 --- a/src/sample.c
20 +++ b/src/sample.c
21 @@ -1245,15 +1245,11 @@ int smp_resolve_args(struct proxy *p)
22                         break;
23  
24                 case ARGT_TAB:
25 -                       if (!arg->data.str.data) {
26 -                               ha_alert("parsing [%s:%d] : missing table name in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
27 -                                        cur->file, cur->line,
28 -                                        cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
29 -                               cfgerr++;
30 -                               continue;
31 -                       }
32 +                       if (arg->data.str.data)
33 +                               stktname = arg->data.str.area;
34 +                       else
35 +                               stktname = px->id;
36  
37 -                       stktname = arg->data.str.area;
38                         t = stktable_find_by_name(stktname);
39                         if (!t) {
40                                 ha_alert("parsing [%s:%d] : unable to find table '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
git clone https://git.99rst.org/PROJECT