]> granicus.if.org Git - icinga2/commitdiff
Don't allow "ignore where" for groups when there's no "assign where"
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 16 Jul 2015 11:55:53 +0000 (13:55 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 16 Jul 2015 11:56:12 +0000 (13:56 +0200)
fixes #9554

lib/config/config_parser.yy

index de353ada68431ee11272bea0c0e7eecfbe0d2b4d..1abcb16a4fda6a9831276f60ade5693d803969a2 100644 (file)
@@ -380,6 +380,8 @@ object:
                } else if (seen_ignore) {
                        if (!ObjectRule::IsValidSourceType(type))
                                BOOST_THROW_EXCEPTION(ScriptError("object rule 'ignore' cannot be used for type '" + type + "'", DebugInfoRange(@2, @4)));
+                       else
+                               BOOST_THROW_EXCEPTION(ScriptError("object rule 'ignore' is missing 'assign' for type '" + type + "'", DebugInfoRange(@2, @4)));
                }
 
                $$ = new ObjectExpression(abstract, type, $4, filter, context->GetZone(), $5, $6, DebugInfoRange(@2, @5));