|
|
|
@ -74,6 +74,11 @@ char *SCRuleVarsGetConfVar(const DetectEngineCtx *de_ctx,
|
|
|
|
|
|
|
|
|
|
if (conf_var_name == NULL)
|
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
|
|
while (conf_var_name[0] != '\0' && isspace(conf_var_name[0])) {
|
|
|
|
|
conf_var_name++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(conf_var_name[0] == '$') ? conf_var_name++ : conf_var_name;
|
|
|
|
|
conf_var_type_name = SCMapEnumValueToName(conf_vars_type,
|
|
|
|
|
sc_rule_vars_type_map);
|
|
|
|
@ -214,6 +219,11 @@ int SCRuleVarsPositiveTest01(void)
|
|
|
|
|
strcmp(SCRuleVarsGetConfVar(NULL,"$AIM_SERVERS", SC_RULE_VARS_ADDRESS_GROUPS),
|
|
|
|
|
"any") == 0);
|
|
|
|
|
|
|
|
|
|
/* Test that a leading space is stripped. */
|
|
|
|
|
result &= (SCRuleVarsGetConfVar(NULL," $AIM_SERVERS", SC_RULE_VARS_ADDRESS_GROUPS) != NULL &&
|
|
|
|
|
strcmp(SCRuleVarsGetConfVar(NULL," $AIM_SERVERS", SC_RULE_VARS_ADDRESS_GROUPS),
|
|
|
|
|
"any") == 0);
|
|
|
|
|
|
|
|
|
|
/* check for port-groups */
|
|
|
|
|
result &= (SCRuleVarsGetConfVar(NULL,"$HTTP_PORTS", SC_RULE_VARS_PORT_GROUPS) != NULL &&
|
|
|
|
|
strcmp(SCRuleVarsGetConfVar(NULL,"$HTTP_PORTS", SC_RULE_VARS_PORT_GROUPS),
|
|
|
|
|