From f02c87b14cac96d1d511f1acb2eeef55b63dac8e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 8 Jan 2015 11:36:53 +0100 Subject: [PATCH] Fix missing command arguments fixes #8144 --- lib/icinga/pluginutility.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/icinga/pluginutility.cpp b/lib/icinga/pluginutility.cpp index 3fe81a98f..33c6bcd62 100644 --- a/lib/icinga/pluginutility.cpp +++ b/lib/icinga/pluginutility.cpp @@ -196,17 +196,13 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab Array::Ptr command_arr = command; BOOST_FOREACH(const CommandArgument& arg, args) { - Array::Ptr arr; - if (arg.AValue.IsString()) - AddArgumentHelper(command_arr, arg.Key, arg.AValue, !arg.SkipKey, !arg.SkipValue); - else if (arg.AValue.IsObjectType()) - arr = static_cast(arg.AValue); - else + if (arg.AValue.IsObjectType()) { + Log(LogWarning, "PluginUtility", "Tried to use dictionary in argument"); continue; - - if (arr) { + } else if (arg.AValue.IsObjectType()) { bool first = true; + Array::Ptr arr = static_cast(arg.AValue); ObjectLock olock(arr); BOOST_FOREACH(const Value& value, arr) { @@ -217,11 +213,11 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab add_key = !arg.SkipKey; } else add_key = !arg.SkipKey && arg.RepeatKey; - AddArgumentHelper(command_arr, arg.Key, value, add_key, !arg.SkipValue); } - } + } else + AddArgumentHelper(command_arr, arg.Key, arg.AValue, !arg.SkipKey, !arg.SkipValue); } } -- 2.49.0