Replaced initializer list with in-class initializer in AuditLog

This commit is contained in:
szedenik-adam 2025-08-07 10:23:50 +02:00
parent 31fb9390c2
commit 01c427f6be
2 changed files with 14 additions and 27 deletions

View File

@ -183,32 +183,32 @@ class AuditLog {
bool merge(AuditLog *from, std::string *error); bool merge(AuditLog *from, std::string *error);
std::string m_path1; std::string m_path1 = std::string("");
std::string m_path2; std::string m_path2 = std::string("");
std::string m_storage_dir; std::string m_storage_dir = std::string("");
std::string m_header; std::string m_header = std::string("");
AuditLogFormat m_format; AuditLogFormat m_format = NotSetAuditLogFormat;
protected: protected:
int m_parts; int m_parts = -1;
int m_defaultParts = AAuditLogPart | BAuditLogPart | CAuditLogPart int m_defaultParts = AAuditLogPart | BAuditLogPart | CAuditLogPart
| FAuditLogPart | HAuditLogPart | ZAuditLogPart; | FAuditLogPart | HAuditLogPart | ZAuditLogPart;
int m_filePermission; int m_filePermission = -1;
int m_defaultFilePermission = 0640; int m_defaultFilePermission = 0640;
int m_directoryPermission; int m_directoryPermission = -1;
int m_defaultDirectoryPermission = 0750; int m_defaultDirectoryPermission = 0750;
private: private:
AuditLogStatus m_status; AuditLogStatus m_status = NotSetLogStatus;
AuditLogType m_type; AuditLogType m_type = NotSetAuditLogType;
std::string m_relevant; std::string m_relevant = std::string("");
audit_log::writer::Writer *m_writer; audit_log::writer::Writer *m_writer = NULL;
bool m_ctlAuditEngineActive; // rules have at least one action On or RelevantOnly bool m_ctlAuditEngineActive = false; // rules have at least one action On or RelevantOnly
}; };

View File

@ -51,20 +51,7 @@ namespace modsecurity {
namespace audit_log { namespace audit_log {
AuditLog::AuditLog() AuditLog::AuditLog() { }
: m_path1(""),
m_path2(""),
m_storage_dir(""),
m_header(""),
m_format(NotSetAuditLogFormat),
m_parts(-1),
m_filePermission(-1),
m_directoryPermission(-1),
m_status(NotSetLogStatus),
m_type(NotSetAuditLogType),
m_relevant(""),
m_writer(NULL),
m_ctlAuditEngineActive(false) { }
AuditLog::~AuditLog() { AuditLog::~AuditLog() {