@@ -262,7 +262,7 @@ void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trans,
262
262
263
263
for (actions::SetVar *a : m_actionsSetVar) {
264
264
ms_dbg_a (trans, 4 , " Running [independent] (non-disruptive) " \
265
- " action: " + a->m_name );
265
+ " action: " + * a->m_name . get () );
266
266
267
267
a->evaluate (this , trans);
268
268
}
@@ -273,12 +273,12 @@ void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trans,
273
273
continue ;
274
274
}
275
275
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" ) {
277
277
ms_dbg_a (trans, 9 , " Rule contains a `block' action" );
278
278
*containsBlock = true ;
279
- } else if (a->m_name == " setvar" ) {
279
+ } else if (* a->m_name . get () == " setvar" ) {
280
280
ms_dbg_a (trans, 4 , " Running [independent] (non-disruptive) " \
281
- " action: " + a->m_name );
281
+ " action: " + * a->m_name . get () );
282
282
a->evaluate (this , trans, ruleMessage);
283
283
}
284
284
}
@@ -340,22 +340,21 @@ inline void Rule::executeTransformation(actions::Action *a,
340
340
if (newValue != *oldValue) {
341
341
std::shared_ptr<std::string> u (new std::string (newValue));
342
342
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 ));
345
344
(*nth)++;
346
345
}
347
346
*value = u;
348
347
}
349
348
350
349
if (path->empty ()) {
351
- path->append (a->m_name );
350
+ path->append (* a->m_name . get () );
352
351
} else {
353
- path->append (" ," + a->m_name );
352
+ path->append (" ," + * a->m_name . get () );
354
353
}
355
354
356
355
ms_dbg_a (trans, 9 , " T (" + \
357
356
std::to_string (*nth) + " ) " + \
358
- a->m_name + " : \" " + \
357
+ * a->m_name . get () + " : \" " + \
359
358
utils::string::limitTo (80 , newValue) +" \" " );
360
359
}
361
360
@@ -540,28 +539,28 @@ inline void Rule::getFinalVars(variables::Variables *vars,
540
539
void Rule::executeAction (Transaction *trans,
541
540
bool containsBlock, std::shared_ptr<RuleMessage> ruleMessage,
542
541
Action *a, bool defaultContext) {
543
- if (a->isDisruptive () == false && a->m_name != " block" ) {
542
+ if (a->isDisruptive () == false && * a->m_name . get () != " block" ) {
544
543
ms_dbg_a (trans, 9 , " Running " \
545
- " action: " + a->m_name );
544
+ " action: " + * a->m_name . get () );
546
545
a->evaluate (this , trans, ruleMessage);
547
546
return ;
548
547
}
549
548
550
549
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 () + \
552
551
" (rule does not cotains block)" );
553
552
return ;
554
553
}
555
554
556
555
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 () + \
558
557
" ." );
559
558
a->evaluate (this , trans, ruleMessage);
560
559
return ;
561
560
}
562
561
563
562
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." );
565
564
}
566
565
567
566
@@ -581,7 +580,7 @@ void Rule::executeActionsAfterFullMatch(Transaction *trans,
581
580
582
581
for (actions::Tag *a : this ->m_actionsTag ) {
583
582
ms_dbg_a (trans, 4 , " Running (non-disruptive) action: " \
584
- + a->m_name );
583
+ + * a->m_name . get () );
585
584
a->evaluate (this , trans, ruleMessage);
586
585
}
587
586
@@ -811,12 +810,12 @@ std::vector<actions::Action *> Rule::getActionsByName(const std::string& name,
811
810
Transaction *trans) {
812
811
std::vector<actions::Action *> ret;
813
812
for (auto &z : m_actionsRuntimePos) {
814
- if (z->m_name == name) {
813
+ if (* z->m_name . get () == name) {
815
814
ret.push_back (z);
816
815
}
817
816
}
818
817
for (auto &z : m_actionsRuntimePre) {
819
- if (z->m_name == name) {
818
+ if (* z->m_name . get () == name) {
820
819
ret.push_back (z);
821
820
}
822
821
}
@@ -826,7 +825,7 @@ std::vector<actions::Action *> Rule::getActionsByName(const std::string& name,
826
825
continue ;
827
826
}
828
827
actions::Action *z = dynamic_cast <actions::Action*>(b.second .get ());
829
- if (z->m_name == name) {
828
+ if (* z->m_name . get () == name) {
830
829
ret.push_back (z);
831
830
}
832
831
}
@@ -836,7 +835,7 @@ std::vector<actions::Action *> Rule::getActionsByName(const std::string& name,
836
835
continue ;
837
836
}
838
837
actions::Action *z = dynamic_cast <actions::Action*>(b.second .get ());
839
- if (z->m_name == name) {
838
+ if (* z->m_name . get () == name) {
840
839
ret.push_back (z);
841
840
}
842
841
}
0 commit comments