mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Fix the init method signature in some operators
This commit is contained in:
parent
4a5e6b3e57
commit
90c74beca1
@ -25,8 +25,9 @@ namespace operators {
|
|||||||
|
|
||||||
bool Ge::evaluate(Assay *assay, const std::string &input) {
|
bool Ge::evaluate(Assay *assay, const std::string &input) {
|
||||||
std::string p = MacroExpansion::expand(param, assay);
|
std::string p = MacroExpansion::expand(param, assay);
|
||||||
|
std::string i = MacroExpansion::expand(input, assay);
|
||||||
|
|
||||||
bool ge = atoll(p.c_str()) >= atoll(p.c_str());
|
bool ge = atoll(i.c_str()) >= atoll(p.c_str());
|
||||||
|
|
||||||
if (negation) {
|
if (negation) {
|
||||||
return !ge;
|
return !ge;
|
||||||
|
@ -28,7 +28,7 @@ class InspectFile : public Operator {
|
|||||||
public:
|
public:
|
||||||
/** @ingroup ModSecurity_Operator */
|
/** @ingroup ModSecurity_Operator */
|
||||||
InspectFile(std::string o, std::string p, bool i);
|
InspectFile(std::string o, std::string p, bool i);
|
||||||
bool evaluate(Assay *assay);
|
bool evaluate(Assay *assay) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace operators
|
} // namespace operators
|
||||||
|
@ -25,7 +25,7 @@ namespace ModSecurity {
|
|||||||
namespace operators {
|
namespace operators {
|
||||||
|
|
||||||
|
|
||||||
bool IpMatch::init(const char **error) {
|
bool IpMatch::init(const std::string &file, const char **error) {
|
||||||
std::string e("");
|
std::string e("");
|
||||||
bool res = m_tree.addFromBuffer(param, &e);
|
bool res = m_tree.addFromBuffer(param, &e);
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ class IpMatch : public Operator {
|
|||||||
IpMatch(std::string op, std::string param, bool negation)
|
IpMatch(std::string op, std::string param, bool negation)
|
||||||
: Operator(op, param, negation) { }
|
: Operator(op, param, negation) { }
|
||||||
|
|
||||||
bool evaluate(Assay *assay, const std::string &input);
|
bool evaluate(Assay *assay, const std::string &input) override;
|
||||||
|
|
||||||
virtual bool init(const char **error);
|
virtual bool init(const std::string &file, const char **error) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Utils::IpTree m_tree;
|
Utils::IpTree m_tree;
|
||||||
|
@ -85,7 +85,7 @@ bool Pm::evaluate(Assay *assay, const std::string &input) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Pm::init(const char **error) {
|
bool Pm::init(const std::string &file, const char **error) {
|
||||||
std::vector<std::string> vec;
|
std::vector<std::string> vec;
|
||||||
|
|
||||||
replaceAll(param, "\\", "\\\\");
|
replaceAll(param, "\\", "\\\\");
|
||||||
|
@ -37,9 +37,9 @@ class Pm : public Operator {
|
|||||||
~Pm();
|
~Pm();
|
||||||
void replaceAll(std::string str, const std::string& from,
|
void replaceAll(std::string str, const std::string& from,
|
||||||
const std::string& to);
|
const std::string& to);
|
||||||
bool evaluate(Assay *assay, const std::string &input);
|
bool evaluate(Assay *assay, const std::string &input) override;
|
||||||
|
|
||||||
virtual bool init(const char **error);
|
virtual bool init(const std::string &file, const char **error) override;
|
||||||
void postOrderTraversal(acmp_btree_node_t *node);
|
void postOrderTraversal(acmp_btree_node_t *node);
|
||||||
|
|
||||||
std::list<std::string> matched;
|
std::list<std::string> matched;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user