兼容拦截策略中字符串格式的keyring

This commit is contained in:
zhengchao
2019-06-15 12:43:24 +08:00
parent 6e6fdfd010
commit 0db61c2a66

View File

@@ -81,7 +81,21 @@ void intercept_param_new_cb(int table_id, const char* key, const char* table_lin
param->keyring=1;
item=cJSON_GetObjectItem(json, "keyring");
if(item && item->type==cJSON_Number) param->keyring=item->valueint;
if(item)
{
if(item->type==cJSON_Number)
{
param->keyring=item->valueint;
}
else if(item->type==cJSON_String)
{
param->keyring=atoi(item->valuestring);
}
else
{
TFE_LOG_ERROR(enforcer->logger, "Invalid intercept parameter: %d invalid keyring format", param->policy_id);
}
}
exclusions=cJSON_GetObjectItem(json, "exclusions");
if(exclusions)