You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.5 KiB

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