mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
MAJOR: acl: remove fetch argument validation from the ACL struct
ACL fetch being inherited from the sample fetch keyword, we don't need anymore to specify what function to use to validate the fetch arguments. Note that the job is still done in the ACL parsing code based on elements from the sample fetch structs.
This commit is contained in:
parent
c48c90dfa5
commit
9baae63d8d
@ -237,7 +237,6 @@ struct acl_keyword {
|
|||||||
int (*parse)(const char **text, struct acl_pattern *pattern, int *opaque, char **err);
|
int (*parse)(const char **text, struct acl_pattern *pattern, int *opaque, char **err);
|
||||||
int (*match)(struct sample *smp, struct acl_pattern *pattern);
|
int (*match)(struct sample *smp, struct acl_pattern *pattern);
|
||||||
unsigned int requires; /* bit mask of all ACL_USE_* required to evaluate this keyword */
|
unsigned int requires; /* bit mask of all ACL_USE_* required to evaluate this keyword */
|
||||||
int (*val_args)(struct arg *arg_p, char **err_msg); /* argument validation function */
|
|
||||||
/* must be after the config params */
|
/* must be after the config params */
|
||||||
struct sample_fetch *smp; /* the sample fetch we depend on */
|
struct sample_fetch *smp; /* the sample fetch we depend on */
|
||||||
int use_cnt;
|
int use_cnt;
|
||||||
|
@ -1052,7 +1052,7 @@ struct acl_expr *parse_acl_expr(const char **args, char **err)
|
|||||||
if (!expr->args)
|
if (!expr->args)
|
||||||
expr->args = empty_arg_list;
|
expr->args = empty_arg_list;
|
||||||
|
|
||||||
if (aclkw->val_args && !aclkw->val_args(expr->args, err)) {
|
if (aclkw->smp->val_args && !aclkw->smp->val_args(expr->args, err)) {
|
||||||
/* invalid keyword argument, error must have been
|
/* invalid keyword argument, error must have been
|
||||||
* set by val_args().
|
* set by val_args().
|
||||||
*/
|
*/
|
||||||
|
@ -669,8 +669,8 @@ static struct sample_fetch_kw_list smp_kws = {{ },{
|
|||||||
* Please take care of keeping this list alphabetically sorted.
|
* Please take care of keeping this list alphabetically sorted.
|
||||||
*/
|
*/
|
||||||
static struct acl_kw_list acl_kws = {{ },{
|
static struct acl_kw_list acl_kws = {{ },{
|
||||||
{ "payload", NULL, acl_parse_str, acl_match_str, ACL_USE_L6REQ_VOLATILE, val_payload },
|
{ "payload", NULL, acl_parse_str, acl_match_str, ACL_USE_L6REQ_VOLATILE },
|
||||||
{ "payload_lv", NULL, acl_parse_str, acl_match_str, ACL_USE_L6REQ_VOLATILE, val_payload_lv },
|
{ "payload_lv", NULL, acl_parse_str, acl_match_str, ACL_USE_L6REQ_VOLATILE },
|
||||||
{ "rep_ssl_hello_type", NULL, acl_parse_int, acl_match_int, ACL_USE_L6RTR_VOLATILE },
|
{ "rep_ssl_hello_type", NULL, acl_parse_int, acl_match_int, ACL_USE_L6RTR_VOLATILE },
|
||||||
{ "req_len", NULL, acl_parse_int, acl_match_int, ACL_USE_L6REQ_VOLATILE },
|
{ "req_len", NULL, acl_parse_int, acl_match_int, ACL_USE_L6REQ_VOLATILE },
|
||||||
{ "req_rdp_cookie", "rdp_cookie", acl_parse_str, acl_match_str, ACL_USE_L6REQ_VOLATILE },
|
{ "req_rdp_cookie", "rdp_cookie", acl_parse_str, acl_match_str, ACL_USE_L6REQ_VOLATILE },
|
||||||
|
@ -9542,17 +9542,17 @@ static struct acl_kw_list acl_kws = {{ },{
|
|||||||
{ "cook_sub", "cook", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE },
|
{ "cook_sub", "cook", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "cook_val", "cook_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
|
{ "cook_val", "cook_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
|
||||||
|
|
||||||
{ "hdr", "hdr", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr", "hdr", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_beg", "hdr", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr_beg", "hdr", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_cnt", "hdr_cnt", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
|
{ "hdr_cnt", "hdr_cnt", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_dir", "hdr", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr_dir", "hdr", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_dom", "hdr", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr_dom", "hdr", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_end", "hdr", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr_end", "hdr", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_ip", "hdr_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr_ip", "hdr_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_len", "hdr", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr_len", "hdr", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_reg", "hdr", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr_reg", "hdr", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_sub", "hdr", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr_sub", "hdr", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "hdr_val", "hdr_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE, val_hdr },
|
{ "hdr_val", "hdr_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
|
||||||
|
|
||||||
{ "http_auth", NULL, acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_VOLATILE },
|
{ "http_auth", NULL, acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_VOLATILE },
|
||||||
{ "http_auth_group", NULL, acl_parse_strcat, acl_match_auth, ACL_USE_L7REQ_VOLATILE },
|
{ "http_auth_group", NULL, acl_parse_strcat, acl_match_auth, ACL_USE_L7REQ_VOLATILE },
|
||||||
@ -9585,17 +9585,17 @@ static struct acl_kw_list acl_kws = {{ },{
|
|||||||
{ "scook_sub", "scook", acl_parse_str, acl_match_sub, ACL_USE_L7RTR_VOLATILE },
|
{ "scook_sub", "scook", acl_parse_str, acl_match_sub, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "scook_val", "scook_val", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE },
|
{ "scook_val", "scook_val", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE },
|
||||||
|
|
||||||
{ "shdr", "shdr", acl_parse_str, acl_match_str, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr", "shdr", acl_parse_str, acl_match_str, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_beg", "shdr", acl_parse_str, acl_match_beg, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr_beg", "shdr", acl_parse_str, acl_match_beg, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_cnt", "shdr_cnt", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE },
|
{ "shdr_cnt", "shdr_cnt", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_dir", "shdr", acl_parse_str, acl_match_dir, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr_dir", "shdr", acl_parse_str, acl_match_dir, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_dom", "shdr", acl_parse_str, acl_match_dom, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr_dom", "shdr", acl_parse_str, acl_match_dom, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_end", "shdr", acl_parse_str, acl_match_end, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr_end", "shdr", acl_parse_str, acl_match_end, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_ip", "shdr_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr_ip", "shdr_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_len", "shdr", acl_parse_int, acl_match_len, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr_len", "shdr", acl_parse_int, acl_match_len, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_reg", "shdr", acl_parse_reg, acl_match_reg, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr_reg", "shdr", acl_parse_reg, acl_match_reg, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_sub", "shdr", acl_parse_str, acl_match_sub, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr_sub", "shdr", acl_parse_str, acl_match_sub, ACL_USE_L7RTR_VOLATILE },
|
||||||
{ "shdr_val", "shdr_val", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE, val_hdr },
|
{ "shdr_val", "shdr_val", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE },
|
||||||
|
|
||||||
{ "status", NULL, acl_parse_int, acl_match_int, ACL_USE_L7RTR_PERMANENT },
|
{ "status", NULL, acl_parse_int, acl_match_int, ACL_USE_L7RTR_PERMANENT },
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user