]> granicus.if.org Git - icinga2/commitdiff
Update validators for command arguments
authorGunnar Beutner <gunnar@beutner.name>
Thu, 29 Jan 2015 09:30:02 +0000 (10:30 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Thu, 29 Jan 2015 09:30:02 +0000 (10:30 +0100)
refs #7564

lib/icinga/icinga-type.conf
lib/icinga/pluginutility.cpp

index 60470246fc4c0263eb6faeec9f0a2f27c3f030e1..6f5a732824b7992087034346eb4cf4dd39017f0d 100644 (file)
 /*  %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 "*",
index c01688b09da89d6d4508a258bd97252281709fa9..422491bff818632507794f09162f08a438a15963 100644 (file)
@@ -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<Array>())
+       if (!raw_arguments || raw_command.IsObjectType<Array>() || raw_command.IsObjectType<Function>())
                command = MacroProcessor::ResolveMacros(raw_command, macroResolvers, cr, NULL,
                    PluginUtility::EscapeMacroShellArg, resolvedMacros, useResolvedMacros);
        else {