Cosmetics: Fix coding style

This commit is contained in:
Felipe Zimmerle
2015-09-28 16:32:59 -03:00
parent f6e0b447b3
commit b497091017
48 changed files with 136 additions and 92 deletions

View File

@@ -25,8 +25,7 @@ namespace actions {
CtlAuditLogParts::CtlAuditLogParts(std::string action)
: Action(action, RunTimeOnlyIfMatchKind),
mPartsAction(0)
{
mPartsAction(0) {
std::string what(action, 18, 1);
mParts = std::string(action, 19, action.length()-19);
if (what == "+") {

View File

@@ -18,8 +18,8 @@
#include "actions/action.h"
#include "modsecurity/assay.h"
#ifndef SRC_CLT_ACTIONS_AUDIT_LOG_PARTS_H_
#define SRC_CLT_ACTIONS_AUDIT_LOG_PARTS_H_
#ifndef SRC_ACTIONS_CTL_AUDIT_LOG_PARTS_H_
#define SRC_ACTIONS_CTL_AUDIT_LOG_PARTS_H_
namespace ModSecurity {
namespace actions {
@@ -37,4 +37,4 @@ class CtlAuditLogParts : public Action {
} // namespace actions
} // namespace ModSecurity
#endif // SRC_CLT_ACTIONS_AUDIT_LOG_PARTS_H_
#endif // SRC_ACTIONS_CTL_AUDIT_LOG_PARTS_H_

View File

@@ -36,9 +36,6 @@ bool Pass::evaluate(Rule *rule, Assay *assay) {
return true;
}
void Pass::fill_intervention(ModSecurityIntervention *i) {
}
} // namespace actions
} // namespace ModSecurity

View File

@@ -30,7 +30,6 @@ class Pass : public Action {
explicit Pass(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
void fill_intervention(ModSecurityIntervention *i) override;
bool isDisruptive() override { return true; }
};

View File

@@ -43,7 +43,8 @@ Phase::Phase(std::string action)
} catch (...) {
this->phase = 0;
if (tolower(a) == "request") {
this->phase = this->phase + ModSecurity::Phases::RequestHeadersPhase;
this->phase = this->phase +
ModSecurity::Phases::RequestHeadersPhase;
m_secRulesPhase = 2;
}
if (tolower(a) == "response") {

View File

@@ -36,14 +36,16 @@ bool RuleId::init(std::string *error) {
m_ruleId = std::stod(a);
} catch (...) {
m_ruleId = 0;
error->assign("The input \"" + a + "\" does not seems to be a valid rule id.");
error->assign("The input \"" + a + "\" does not " \
"seems to be a valid rule id.");
return false;
}
std::ostringstream oss;
oss << std::setprecision(40) << m_ruleId;
if (a != oss.str() || m_ruleId < 0) {
error->assign("The input \"" + a + "\" does not seems to be a valid rule id.");
error->assign("The input \"" + a + "\" does not seems " \
"to be a valid rule id.");
return false;
}
return true;

View File

@@ -38,7 +38,7 @@ class RuleId : public Action {
bool init(std::string *error) override;
bool evaluate(Rule *rule, Assay *assay) override;
private:
private:
double m_ruleId;
};