@@ -262,7 +262,7 @@ void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trans,
262262
263263 for (actions::SetVar *a : m_actionsSetVar) {
264264 ms_dbg_a (trans, 4 , " Running [independent] (non-disruptive) " \
265- " action: " + a->m_name );
265+ " action: " + * a->m_name . get () );
266266
267267 a->evaluate (this , trans);
268268 }
@@ -273,12 +273,12 @@ void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trans,
273273 continue ;
274274 }
275275 actions::Action *a = dynamic_cast <actions::Action*>(b.second .get ());
276- if (a->isDisruptive () == true && a->m_name == " block" ) {
276+ if (a->isDisruptive () == true && * a->m_name . get () == " block" ) {
277277 ms_dbg_a (trans, 9 , " Rule contains a `block' action" );
278278 *containsBlock = true ;
279- } else if (a->m_name == " setvar" ) {
279+ } else if (* a->m_name . get () == " setvar" ) {
280280 ms_dbg_a (trans, 4 , " Running [independent] (non-disruptive) " \
281- " action: " + a->m_name );
281+ " action: " + * a->m_name . get () );
282282 a->evaluate (this , trans, ruleMessage);
283283 }
284284 }
@@ -340,22 +340,21 @@ inline void Rule::executeTransformation(actions::Action *a,
340340 if (newValue != *oldValue) {
341341 std::shared_ptr<std::string> u (new std::string (newValue));
342342 if (m_containsMultiMatchAction) {
343- std::shared_ptr<std::string> t (new std::string (a->m_name ));
344- ret->push_back (std::make_pair (u, t));
343+ ret->push_back (std::make_pair (u, a->m_name ));
345344 (*nth)++;
346345 }
347346 *value = u;
348347 }
349348
350349 if (path->empty ()) {
351- path->append (a->m_name );
350+ path->append (* a->m_name . get () );
352351 } else {
353- path->append (" ," + a->m_name );
352+ path->append (" ," + * a->m_name . get () );
354353 }
355354
356355 ms_dbg_a (trans, 9 , " T (" + \
357356 std::to_string (*nth) + " ) " + \
358- a->m_name + " : \" " + \
357+ * a->m_name . get () + " : \" " + \
359358 utils::string::limitTo (80 , newValue) +" \" " );
360359}
361360
@@ -540,28 +539,28 @@ inline void Rule::getFinalVars(variables::Variables *vars,
540539void Rule::executeAction (Transaction *trans,
541540 bool containsBlock, std::shared_ptr<RuleMessage> ruleMessage,
542541 Action *a, bool defaultContext) {
543- if (a->isDisruptive () == false && a->m_name != " block" ) {
542+ if (a->isDisruptive () == false && * a->m_name . get () != " block" ) {
544543 ms_dbg_a (trans, 9 , " Running " \
545- " action: " + a->m_name );
544+ " action: " + * a->m_name . get () );
546545 a->evaluate (this , trans, ruleMessage);
547546 return ;
548547 }
549548
550549 if (defaultContext && !containsBlock) {
551- ms_dbg_a (trans, 4 , " Ignoring action: " + a->m_name + \
550+ ms_dbg_a (trans, 4 , " Ignoring action: " + * a->m_name . get () + \
552551 " (rule does not cotains block)" );
553552 return ;
554553 }
555554
556555 if (trans->getRuleEngineState () == RulesSet::EnabledRuleEngine) {
557- ms_dbg_a (trans, 4 , " Running (disruptive) action: " + a->m_name + \
556+ ms_dbg_a (trans, 4 , " Running (disruptive) action: " + * a->m_name . get () + \
558557 " ." );
559558 a->evaluate (this , trans, ruleMessage);
560559 return ;
561560 }
562561
563562 ms_dbg_a (trans, 4 , " Not running any disruptive action (or block): " \
564- + a->m_name + " . SecRuleEngine is not On." );
563+ + * a->m_name . get () + " . SecRuleEngine is not On." );
565564}
566565
567566
@@ -581,7 +580,7 @@ void Rule::executeActionsAfterFullMatch(Transaction *trans,
581580
582581 for (actions::Tag *a : this ->m_actionsTag ) {
583582 ms_dbg_a (trans, 4 , " Running (non-disruptive) action: " \
584- + a->m_name );
583+ + * a->m_name . get () );
585584 a->evaluate (this , trans, ruleMessage);
586585 }
587586
@@ -811,12 +810,12 @@ std::vector<actions::Action *> Rule::getActionsByName(const std::string& name,
811810 Transaction *trans) {
812811 std::vector<actions::Action *> ret;
813812 for (auto &z : m_actionsRuntimePos) {
814- if (z->m_name == name) {
813+ if (* z->m_name . get () == name) {
815814 ret.push_back (z);
816815 }
817816 }
818817 for (auto &z : m_actionsRuntimePre) {
819- if (z->m_name == name) {
818+ if (* z->m_name . get () == name) {
820819 ret.push_back (z);
821820 }
822821 }
@@ -826,7 +825,7 @@ std::vector<actions::Action *> Rule::getActionsByName(const std::string& name,
826825 continue ;
827826 }
828827 actions::Action *z = dynamic_cast <actions::Action*>(b.second .get ());
829- if (z->m_name == name) {
828+ if (* z->m_name . get () == name) {
830829 ret.push_back (z);
831830 }
832831 }
@@ -836,7 +835,7 @@ std::vector<actions::Action *> Rule::getActionsByName(const std::string& name,
836835 continue ;
837836 }
838837 actions::Action *z = dynamic_cast <actions::Action*>(b.second .get ());
839- if (z->m_name == name) {
838+ if (* z->m_name . get () == name) {
840839 ret.push_back (z);
841840 }
842841 }
0 commit comments