Code

frontend, parser: Allow typed access to host objects from any context.
[sysdb.git] / src / frontend / analyzer.c
index 4bd370222e8e11d4a41e9a3b297a1e35412155be..01e1ad357adec6502fc7efc74768bee7cdf03969 100644 (file)
@@ -95,7 +95,8 @@ analyze_expr(int context, sdb_store_expr_t *e, sdb_strbuf_t *errbuf)
                        if (context == (int)e->data.data.integer)
                                return 0;
                        if ((e->data.data.integer == SDB_HOST) &&
-                                       ((context == SDB_SERVICE) || (context == SDB_METRIC)))
+                                       ((context == SDB_SERVICE) || (context == SDB_METRIC)
+                                               || (context < 0)))
                                return 0;
                        sdb_strbuf_sprintf(errbuf, "Invalid expression %s.%s "
                                        "in %s context",