From dd4a7ab240c9d445adc62489ef5c94e07785897a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 29 Jan 2015 10:30:02 +0100 Subject: [PATCH] Update validators for command arguments refs #7564 --- lib/icinga/icinga-type.conf | 2 ++ lib/icinga/pluginutility.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/icinga/icinga-type.conf b/lib/icinga/icinga-type.conf index 60470246f..6f5a73282 100644 --- a/lib/icinga/icinga-type.conf +++ b/lib/icinga/icinga-type.conf @@ -193,8 +193,10 @@ /* %if (methods.execute == "PluginNotification" || methods.execute == "PluginCheck" || methods.execute == "PluginEvent") { */ // %require "command", %attribute %string "command", + %attribute %function "command", %attribute %array "command" { %attribute %string "*" + %attribute %function "*", }, %attribute %dictionary "arguments" { %attribute %string "*", diff --git a/lib/icinga/pluginutility.cpp b/lib/icinga/pluginutility.cpp index c01688b09..422491bff 100644 --- a/lib/icinga/pluginutility.cpp +++ b/lib/icinga/pluginutility.cpp @@ -89,7 +89,7 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab Dictionary::Ptr raw_arguments = commandObj->GetArguments(); Value command; - if (!raw_arguments || raw_command.IsObjectType()) + if (!raw_arguments || raw_command.IsObjectType() || raw_command.IsObjectType()) command = MacroProcessor::ResolveMacros(raw_command, macroResolvers, cr, NULL, PluginUtility::EscapeMacroShellArg, resolvedMacros, useResolvedMacros); else {