Initial support for Lua script engine

This commit is contained in:
Felipe Zimmerle
2017-11-05 10:42:40 -03:00
parent 1866a3a9eb
commit a676f313c3
19 changed files with 1270 additions and 59 deletions

View File

@@ -19,6 +19,7 @@
#include <string>
#include "src/operators/operator.h"
#include "src/engine/lua.h"
namespace modsecurity {
@@ -29,15 +30,19 @@ class InspectFile : public Operator {
/** @ingroup ModSecurity_Operator */
InspectFile(std::string o, std::string p, bool n)
: Operator(o, p, n),
m_file("") { }
m_file(""),
m_isScript(false) { }
explicit InspectFile(std::string param)
: Operator("InspectFile", param),
m_file("") { }
m_file(""),
m_isScript(false) { }
bool init(const std::string &param, std::string *error) override;
bool evaluate(Transaction *transaction, const std::string &str) override;
private:
std::string m_file;
bool m_isScript;
engine::Lua m_lua;
};
} // namespace operators