]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: sample: Wrong stick-table name parsing in "if/unless" ACL condition.
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 20 Jun 2019 07:31:04 +0000 (09:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Jun 2019 07:48:28 +0000 (09:48 +0200)
This bug was introduced by 1b8e68e commit which supposed the stick-table was always
stored in struct arg at parsing time. This is never the case with the usage of
"if/unless" conditions in stick-table declared as backends. In this case, this is
the name of the proxy which must be considered as the stick-table name.

This must be backported to 2.0.

src/sample.c

index 96102504b022ab0b8ee98deeea09a81839e90fca..94c605f9279b02754a5c534cf7c219cef66c731a 100644 (file)
@@ -1245,15 +1245,11 @@ int smp_resolve_args(struct proxy *p)
                        break;
 
                case ARGT_TAB:
-                       if (!arg->data.str.data) {
-                               ha_alert("parsing [%s:%d] : missing table name in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
-                                        cur->file, cur->line,
-                                        cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
-                               cfgerr++;
-                               continue;
-                       }
+                       if (arg->data.str.data)
+                               stktname = arg->data.str.area;
+                       else
+                               stktname = px->id;
 
-                       stktname = arg->data.str.area;
                        t = stktable_find_by_name(stktname);
                        if (!t) {
                                ha_alert("parsing [%s:%d] : unable to find table '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",