MCPcopy Create free account
hub / github.com/Icinga/icinga2 / EscapeMacroShellArg

Method EscapeMacroShellArg

lib/icinga/macroprocessor.cpp:422–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422Value MacroProcessor::EscapeMacroShellArg(const Value& value)
423{
424 String result;
425
426 if (value.IsObjectType<Array>()) {
427 Array::Ptr arr = value;
428
429 ObjectLock olock(arr);
430 for (const Value& arg : arr) {
431 if (result.GetLength() > 0)
432 result += " ";
433
434 result += Utility::EscapeShellArg(arg);
435 }
436 } else
437 result = Utility::EscapeShellArg(value);
438
439 return result;
440}
441
442struct CommandArgument
443{

Callers

nothing calls this directly

Calls 1

GetLengthMethod · 0.45

Tested by

no test coverage detected