兼容拦截策略中字符串格式的keyring
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user