Coding style fixes

This commit is contained in:
Felipe Zimmerle
2017-11-13 14:22:17 -03:00
parent 023e7acbad
commit 3fb71f32d8
40 changed files with 591 additions and 662 deletions

View File

@@ -206,7 +206,7 @@ class AuditLog {
int m_directoryPermission;
int m_defaultDirectoryPermission = 0750;
private:
private:
AuditLogStatus m_status;
AuditLogType m_type;

View File

@@ -19,6 +19,7 @@
#include <iostream>
#include <memory>
#include <list>
#include <utility>
#endif
#include "modsecurity/variable_origin.h"
@@ -51,7 +52,7 @@ class Variable {
m_key(""),
m_value("") { }
Variable(const Variable *o) :
explicit Variable(const Variable *o) :
m_key(""),
m_value("") {
m_key.assign(o->m_key);

View File

@@ -52,7 +52,8 @@ class Rule {
explicit Rule(std::string marker);
~Rule();
virtual bool evaluate(Transaction *transaction, std::shared_ptr<RuleMessage> rm);
virtual bool evaluate(Transaction *transaction,
std::shared_ptr<RuleMessage> rm);
bool evaluateActions(Transaction *transaction);
std::vector<std::unique_ptr<collection::Variable>>
getFinalVars(Transaction *trasn);
@@ -108,7 +109,7 @@ class Rule {
operators::Operator *m_op;
int m_phase;
std::string m_rev;
long m_ruleId;
int64_t m_ruleId;
bool m_secMarker;
std::vector<Variables::Variable *> *m_variables;
std::string m_ver;

View File

@@ -76,7 +76,8 @@ class RuleMessage {
return RuleMessage::log(this, props, responseCode);
}
std::string errorLog() {
return RuleMessage::log(this, ClientLogMessageInfo | ErrorLogTailLogMessageInfo);
return RuleMessage::log(this,
ClientLogMessageInfo | ErrorLogTailLogMessageInfo);
}
static std::string log(const RuleMessage *rm, int props, int code);

View File

@@ -48,26 +48,29 @@ class RulesExceptions {
bool addRange(int a, int b);
bool addNumber(int a);
bool contains(int a);
bool merge(RulesExceptions& from);
bool merge(RulesExceptions *from);
bool loadRemoveRuleByMsg(const std::string &msg, std::string *error);
bool loadRemoveRuleByTag(const std::string &msg, std::string *error);
bool loadUpdateTargetByMsg(const std::string &msg,
std::unique_ptr<std::vector<std::unique_ptr<Variables::Variable> > > var,
std::unique_ptr<std::vector<std::unique_ptr<Variables::Variable> > > v,
std::string *error);
bool loadUpdateTargetByTag(const std::string &tag,
std::unique_ptr<std::vector<std::unique_ptr<Variables::Variable> > > var,
std::unique_ptr<std::vector<std::unique_ptr<Variables::Variable> > > v,
std::string *error);
bool loadUpdateTargetById(double id,
std::unique_ptr<std::vector<std::unique_ptr<Variables::Variable> > > var,
std::unique_ptr<std::vector<std::unique_ptr<Variables::Variable> > > v,
std::string *error);
std::unordered_multimap<std::shared_ptr<std::string>, std::unique_ptr<Variables::Variable>> m_variable_update_target_by_tag;
std::unordered_multimap<std::shared_ptr<std::string>, std::unique_ptr<Variables::Variable>> m_variable_update_target_by_msg;
std::unordered_multimap<double, std::unique_ptr<Variables::Variable>> m_variable_update_target_by_id;
std::unordered_multimap<std::shared_ptr<std::string>,
std::unique_ptr<Variables::Variable>> m_variable_update_target_by_tag;
std::unordered_multimap<std::shared_ptr<std::string>,
std::unique_ptr<Variables::Variable>> m_variable_update_target_by_msg;
std::unordered_multimap<double,
std::unique_ptr<Variables::Variable>> m_variable_update_target_by_id;
std::list<std::string> m_remove_rule_by_msg;
std::list<std::string> m_remove_rule_by_tag;

View File

@@ -355,7 +355,7 @@ class RulesProperties {
to->m_httpblKey.m_set = from->m_httpblKey.m_set;
}
to->m_exceptions.merge(from->m_exceptions);
to->m_exceptions.merge(&from->m_exceptions);
to->m_components.insert(to->m_components.end(),
from->m_components.begin(), from->m_components.end());

View File

@@ -323,7 +323,7 @@ class Transaction : public TransactionAnchoredVariables {
size_t getRequestBodyLength();
#ifndef NO_LOGS
void debug(int, std::string);
void debug(int, std::string) const;
#endif
void serverLog(std::shared_ptr<RuleMessage> rm);