summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2022-11-16 12:48:11 +0800
committerfengweihao <[email protected]>2022-11-16 12:48:11 +0800
commit5654924f004092cb9ae85f5b07a1b2ff4882c048 (patch)
treefc60547c0bece49626c860a819215d1acfe81b4d
parent3b28b8d897ef58352505747b59239f082243f5a6 (diff)
bugfix:删除Allow用户自定义判断,获取用户自定义域v4.6.24-20221116
-rw-r--r--plugin/business/tsg-http/src/tsg_http.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugin/business/tsg-http/src/tsg_http.cpp b/plugin/business/tsg-http/src/tsg_http.cpp
index 8481e90..a0ce29f 100644
--- a/plugin/business/tsg-http/src/tsg_http.cpp
+++ b/plugin/business/tsg-http/src/tsg_http.cpp
@@ -388,10 +388,7 @@ void policy_action_param_new(int idx, const struct Maat_rule_t* rule, const char
{
return;
}
- if((unsigned char)rule->action!=PX_ACTION_MANIPULATE&&(unsigned char)rule->action!=PX_ACTION_REJECT)
- {
- return;
- }
+
int rule_id;
cJSON *json=NULL, *rules=NULL, *item=NULL, *sub_item=NULL;
json=cJSON_Parse(srv_def_large);
@@ -1434,6 +1431,7 @@ static inline int action_cmp(enum proxy_action a1, enum proxy_action a2)
static enum proxy_action decide_ctrl_action(const struct Maat_rule_t * hit_rules, size_t n_hit,
struct Maat_rule_t ** enforce_rules, size_t * n_enforce, struct policy_action_param **param)
{
+ void *ex_data=NULL;
size_t n_monit = 0, exist_enforce_num = 0, i = 0;
const struct Maat_rule_t * prior_rule = hit_rules;
struct Maat_rule_t monit_rule[n_hit];
@@ -1475,6 +1473,11 @@ static enum proxy_action decide_ctrl_action(const struct Maat_rule_t * hit_rules
}
*enforce_rules[0]=*prior_rule;
*n_enforce=1;
+ ex_data=Maat_rule_get_ex_data(g_proxy_rt->maat, prior_rule, g_proxy_rt->ctrl_compile_idx);
+ if(ex_data!=NULL)
+ {
+ *param=(struct policy_action_param*)ex_data;
+ }
return PX_ACTION_WHITELIST;
}
@@ -1500,7 +1503,7 @@ static enum proxy_action decide_ctrl_action(const struct Maat_rule_t * hit_rules
memcpy(*enforce_rules + exist_enforce_num + 1, monit_rule, n_monit * sizeof(struct Maat_rule_t));
}
- void *ex_data=Maat_rule_get_ex_data(g_proxy_rt->maat, prior_rule, g_proxy_rt->ctrl_compile_idx);
+ ex_data=Maat_rule_get_ex_data(g_proxy_rt->maat, prior_rule, g_proxy_rt->ctrl_compile_idx);
if(ex_data!=NULL)
{
*param=(struct policy_action_param*)ex_data;