Code

parser: Make sure that each comparator matcher is a host matcher.
authorSebastian Harl <sh@tokkee.org>
Wed, 9 Apr 2014 14:19:44 +0000 (16:19 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 9 Apr 2014 14:19:44 +0000 (16:19 +0200)
commit30ea545159fe6e72bada8e621e2b6f9d59490ba2
tree6d0cb6147901282b263dff62dcac3c96ee642303
parent723ce33d539d7089e4bf675eddf724d7d8df76b9
parser: Make sure that each comparator matcher is a host matcher.

So far, 'NOT (service|attribute).<attr> <cmp> <value>' matches did not work
correctly, because the object matcher was not correctly wrapped into a host
matcher. Since we do not currently support querying any object types besides
hosts, this was wrong.

The respective code has been moved into sdb_store_matcher_parse_cmp() which
also implements and checks the restriction on matching host objects only.

A new set of tests has been introduced which exposed this problem and which
(roughly) verifies the result of a lookup using a parsed matcher.
src/core/store_lookup.c
src/frontend/grammar.y
t/core/store_lookup_test.c