mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
FuzzyHash: if disable giving an run time error instead of config
FuzzyHash operator is optional and only installed if the headers for libfuzzy was found in the system. Otherwise, the FuzzyHash operator is disable during the compilation. After this commit, if some rules tries to use it, ModSecurity will produce an runtime error not a config time error, allowing the web server to procede normal with its operations.
This commit is contained in:
@@ -3789,12 +3789,9 @@ static int msre_op_fuzzy_hash_init(msre_rule *rule, char **error_msg)
|
||||
|
||||
rule->op_param_data = param_data;
|
||||
#else
|
||||
*error_msg = apr_psprintf(rule->ruleset->mp, "ModSecurity was not " \
|
||||
"compiled with ssdeep support.");
|
||||
|
||||
rule->op_param_data = NULL;
|
||||
|
||||
return -1;
|
||||
return 1;
|
||||
#endif
|
||||
return 1;
|
||||
|
||||
@@ -3852,6 +3849,12 @@ static int msre_op_fuzzy_hash_execute(modsec_rec *msr, msre_rule *rule,
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
#else
|
||||
*error_msg = apr_psprintf(rule->ruleset->mp, "ModSecurity was not " \
|
||||
"compiled with ssdeep support.");
|
||||
|
||||
return -1;
|
||||
|
||||
#endif
|
||||
|
||||
/* No match. */
|
||||
|
Reference in New Issue
Block a user