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;