Delete unused copy constructor & assignment operator in Rule, RuleMarker & Action

- Declare other unsupported copy constructor & assignment operators as
  deleted too (RuleWithActions, RuleUnconditional & RuleScript)
This commit is contained in:
Eduardo Arias
2024-06-02 02:03:34 +00:00
parent f180e647a1
commit 2ec640fd76
7 changed files with 37 additions and 147 deletions

View File

@@ -13,15 +13,6 @@
*
*/
#ifdef __cplusplus
#include <stack>
#include <vector>
#include <string>
#include <list>
#include <memory>
#include <utility>
#endif
#ifndef HEADERS_MODSECURITY_RULE_H_
#define HEADERS_MODSECURITY_RULE_H_
@@ -31,6 +22,12 @@
#ifdef __cplusplus
#include <vector>
#include <string>
#include <list>
#include <memory>
#include <utility>
namespace modsecurity {
namespace variables {
class Variable;
@@ -73,18 +70,9 @@ class Rule {
m_phase(modsecurity::Phases::RequestHeadersPhase) {
}
Rule(const Rule &other) :
m_fileName(other.m_fileName),
m_lineNumber(other.m_lineNumber),
m_phase(other.m_phase)
{ }
Rule(const Rule &other) = delete;
Rule &operator=(const Rule& other) {
m_fileName = other.m_fileName;
m_lineNumber = other.m_lineNumber;
m_phase = other.m_phase;
return *this;
}
Rule &operator=(const Rule &other) = delete;
virtual ~Rule() {}