]> granicus.if.org Git - icinga2/commitdiff
Fix shell escaping in the macro processor.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 30 Aug 2013 14:52:13 +0000 (16:52 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 30 Aug 2013 14:52:41 +0000 (16:52 +0200)
lib/icinga/macroprocessor.cpp

index dcb0caf56dfe29a8a7db3635fbea9bfd1721010f..a084e161d3ede772be2d273340e0c8607a6cf4b4 100644 (file)
@@ -94,12 +94,12 @@ String MacroProcessor::InternalResolveMacros(const String& str, const std::vecto
                if (!found)
                        Log(LogWarning, "icinga", "Macro '" + name + "' is not defined.");
 
+               if (escapeFn)
+                       resolved_macro = escapeFn(resolvedMacro);
+
                result.Replace(pos_first, pos_second - pos_first + 1, resolved_macro);
                offset = pos_first + resolved_macro.GetLength();
        }
 
-       if (escapeFn)
-               result = escapeFn(result);
-
        return result;
 }