Uses unique_ptr on REMOTE_USER

This commit is contained in:
Felipe Zimmerle
2020-09-18 11:34:31 -03:00
committed by Felipe Zimmerle
parent 820396f784
commit 7afcd3046d
4 changed files with 41 additions and 41 deletions

View File

@@ -186,7 +186,6 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, void *logCbData)
m_json(NULL),
#endif
m_secRuleEngine(RulesSetProperties::PropertyNotSetRuleEngine),
m_variableRemoteUser(""),
m_logCbData(logCbData),
TransactionAnchoredVariables(this),
TransactionRuleMessageManagement(this) {
@@ -252,7 +251,6 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, char *id, void *logCb
m_json(NULL),
#endif
m_secRuleEngine(RulesSetProperties::PropertyNotSetRuleEngine),
m_variableRemoteUser(""),
m_logCbData(logCbData),
TransactionAnchoredVariables(this),
TransactionRuleMessageManagement(this) {
@@ -1466,14 +1464,8 @@ std::string Transaction::toOldAuditLogFormatIndex(const std::string &filename,
m_variableRequestHeaders.resolveFirst("Host").get())
<< " ";
ss << utils::string::dash_if_empty(this->m_clientIpAddress->c_str()) << " ";
/** TODO: Check variable */
variables::RemoteUser *r = new variables::RemoteUser("REMOTE_USER");
VariableValues l;
r->evaluate(this, &l);
delete r;
ss << utils::string::dash_if_empty(
m_variableRemoteUser.c_str());
ss << utils::string::dash_if_empty(variables::RemoteUser::parserRemoteUser(this).first.c_str());
ss << " ";
/** TODO: Check variable */
//ss << utils::string::dash_if_empty(