mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 21:31:28 +02:00
BUG/MINOR: acl: set arg_list->kw to aclkw->kw string literal if aclkw is found
During configuration parsing *args can contain different addresses, it is changing from line to line. smp_resolve_args() is called after the configuration parsing, it uses arg_list->kw to create an error message, if a userlist referenced in some ACL is absent. This leads to wrong keyword names reported in such message or some garbage is printed. It does not happen in the case of sample fetches. In this case arg_list->kw is assigned to a string literal from the sample_fetch struct returned by find_sample_fetch(). Let's do the same in parse_acl_expr(), when find_acl_kw() lookup returns a corresponding acl_keyword structure. This fixes the issue #3088 at GitHub. This should be backported in all stable versions since 2.6 including 2.6.
This commit is contained in:
parent
ffa926ead3
commit
441cd614f9
@ -164,7 +164,6 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
|
|||||||
|
|
||||||
if (al) {
|
if (al) {
|
||||||
al->ctx = ARGC_ACL; // to report errors while resolving args late
|
al->ctx = ARGC_ACL; // to report errors while resolving args late
|
||||||
al->kw = *args;
|
|
||||||
al->conv = NULL;
|
al->conv = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,6 +171,7 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
|
|||||||
if (aclkw) {
|
if (aclkw) {
|
||||||
/* OK we have a real ACL keyword */
|
/* OK we have a real ACL keyword */
|
||||||
|
|
||||||
|
al->kw = aclkw->kw;
|
||||||
/* build new sample expression for this ACL */
|
/* build new sample expression for this ACL */
|
||||||
smp = calloc(1, sizeof(*smp));
|
smp = calloc(1, sizeof(*smp));
|
||||||
if (!smp) {
|
if (!smp) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user