mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Cosmetics: Defining a type for RuleId
This commit is contained in:
parent
999af35e22
commit
5bd6c58385
@ -95,6 +95,8 @@ namespace modsecurity {
|
||||
*/
|
||||
using ModSecString = std::string;
|
||||
|
||||
using RuleId = int64_t;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Phases enumerator consists in mapping the different stages of a
|
||||
|
@ -45,13 +45,13 @@ class Rules {
|
||||
void dump() const;
|
||||
|
||||
int append(Rules *from,
|
||||
const std::vector<int64_t> &ids,
|
||||
const std::vector<RuleId> &ids,
|
||||
std::ostringstream *err);
|
||||
|
||||
bool insert(const std::shared_ptr<Rule> &rule);
|
||||
|
||||
bool insert(std::shared_ptr<Rule> rule,
|
||||
const std::vector<int64_t> *ids,
|
||||
const std::vector<RuleId> *ids,
|
||||
std::ostringstream *err);
|
||||
|
||||
size_t size() const;
|
||||
|
@ -420,7 +420,7 @@ class RuleWithActions : public Rule {
|
||||
return dst;
|
||||
}
|
||||
|
||||
inline int64_t getId() const { return m_ruleId; }
|
||||
inline RuleId getId() const { return m_ruleId; }
|
||||
void setId(int id) {
|
||||
m_ruleId = id;
|
||||
}
|
||||
@ -455,7 +455,7 @@ class RuleWithActions : public Rule {
|
||||
}
|
||||
|
||||
private:
|
||||
int64_t m_ruleId;
|
||||
RuleId m_ruleId;
|
||||
|
||||
std::shared_ptr<RuleWithActions> m_chainedRuleChild;
|
||||
RuleWithActions *m_chainedRuleParent;
|
||||
|
@ -20,7 +20,7 @@
|
||||
namespace modsecurity {
|
||||
|
||||
|
||||
int Rules::append(Rules *from, const std::vector<int64_t> &ids, std::ostringstream *err) {
|
||||
int Rules::append(Rules *from, const std::vector<RuleId> &ids, std::ostringstream *err) {
|
||||
size_t j = 0;
|
||||
for (; j < from->size(); j++) {
|
||||
RuleWithActions *rule = dynamic_cast<RuleWithActions*>(from->at(j).get());
|
||||
@ -42,7 +42,7 @@ bool Rules::insert(const std::shared_ptr<Rule> &rule) {
|
||||
}
|
||||
|
||||
|
||||
bool Rules::insert(std::shared_ptr<Rule> rule, const std::vector<int64_t> *ids, std::ostringstream *err) {
|
||||
bool Rules::insert(std::shared_ptr<Rule> rule, const std::vector<RuleId> *ids, std::ostringstream *err) {
|
||||
RuleWithActions*r = dynamic_cast<RuleWithActions*>(rule.get());
|
||||
if (r && ids != nullptr
|
||||
&& std::binary_search(ids->begin(), ids->end(), r->getId())) {
|
||||
|
@ -56,6 +56,8 @@ duplicateBranch:src/request_body_processor/multipart.cc:93
|
||||
danglingTempReference:src/modsecurity.cc:204
|
||||
knownConditionTrueFalse:src/operators/validate_url_encoding.cc:77
|
||||
knownConditionTrueFalse:src/operators/verify_svnr.cc:88
|
||||
noConstructor:src/actions/rule_id.h:33
|
||||
functionStatic:src/actions/rule_id.h:35
|
||||
|
||||
noExplicitConstructor:seclang-parser.hh
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user